rust-lang / rust-lang/rust-analyzer
feature request: add an assist to create an alias for an import
Open
Nobody has claimed this yet.
A-assists
C-feature
- Dominant language
- Rust
- Stars
- 16.9k
- Forks
- 2.2k
- Avg merge
- 1d 12h
- Merged PRs (30d)
- 72
Description
It would be helpful to have an assist that lets you enter an alias for an import:
use foo::Bar$0;
fn main() {
Bar::do_something();
}
->
use foo::Bar as Baz;
fn main() {
Baz::do_something();
}
Like the rename assist does, but creates an alias instead of renaming the actual type.
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 examining the existing rename assist, which is the stated model for this feature. Done means an import such as use foo::Bar can be assisted to use an alias such as Baz, with references updated to the alias while the original type remains unchanged.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- rust
- Domain
- devtools
- Issue type
- Feature
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 42/100