forked from rust-lang/rust-analyzer
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Auto merge of rust-lang#16489 - UserIsntAvailable:feat/use-import-ali…
…as, r=Veykril feat!: create alias when renaming an import. ![gif](https://github.com/rust-lang/rust-analyzer/assets/57047985/c593d9a8-b8a0-4e13-9e50-a69c7d0d8749) Closes rust-lang#15858 Implemented: - [x] - Prevent using `reserved` keywords (e.g self) and `_`. - [x] - Rename other modules that might be referencing the import. - [x] - Fix "broken" tests. - [ ] - Rename **only** "direct" references. - [ ] - Test more cases. Future possibilities: 1. Also support `extern crate <name>` syntax. 2. Allow aliasing `self` when it is inside an `UseTreeList`. ~3. If import path already has an alias, "rename" the alias.~ ~[4. Create alias even if path is not the last path segment.](rust-lang#16489 (comment)
- Loading branch information
Showing
1 changed file
with
108 additions
and
15 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters