rust-lang / rust-lang/rust-analyzer
assist: move use statement to top level
Nobody has claimed this yet.
- Dominant language
- Rust
- Stars
- 16.9k
- Forks
- 2.2k
- Avg merge
- 1d 12h
- Merged PRs (30d)
- 72
Description
when the cursor is placed on a use foo::bar; statement which is inside a function[^1] show an assist that moves it to top-level scope, and uses existing strategies to join them with other top-level use statements
[^1]: or anywhere else where such a statement is allowed, except for top-level use statements
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
Start by locating rust-analyzer's assist implementation for use statements and the existing strategies for joining top-level use statements. Verify behavior for a use foo::bar; inside a function and other allowed non-top-level scopes. Done means the assist moves the statement to top-level scope and joins it with existing top-level uses.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- rust
- Domain
- tooling
- Issue type
- Feature
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 45/100