rust-lang / rust-lang/rust-analyzer
'Move item' refactoring
Nobody has claimed this yet.
- Dominant language
- Rust
- Stars
- 16.9k
- Forks
- 2.2k
- Avg merge
- 1d 12h
- Merged PRs (30d)
- 72
Description
This is a feature that I wish we could support very often: Selecting a top-level item and moving it to another module, or selecting an item in an impl block and moving it to another impl block, while fixing up all imports and references. Obviously this would not be easy to implement, but I actually think we could do a useful implementation of this with the analysis we're currently capable of 🙂
The biggest question for me is how to support this UI-wise, since the LSP doesn't offer much for this (code actions are too limited). An alternative would also be to fix up imports when copy/pasting, but LSP doesn't allow that either as far as I know.
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
No files, tests, or entry points are named. Start by reviewing the issue's proposed move and copy/paste workflows alongside the LSP code-action limitations; done would mean a defined UI approach that moves top-level or impl-block items while fixing imports and references.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- rust
- Domain
- devtools
- Issue type
- Feature
- Difficulty
- 5/5
- Estimated time
- Over a week
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 20/100