-
Notifications
You must be signed in to change notification settings - Fork 12.6k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Suggestion: refactor to "renamed" named import #28367
Comments
Just a small addition: Currently, trying to rename an imported symbol renames its source (at least in VS Code). |
This seems to have already been put into effect for some time. On Version: 1.30.2 and this is how F2 / "Symbol Rename" works. I believe it to be a total nuisance! It completely removes the ability to intentionally rename a symbol globally. I don't see any configuration option to switch it back or alternative shortcut. I understand some people find it convenient for it to always alias, but that's single Ctrl+H or a simple "as [something]" in a single file. On the other hand if I am actively working on a feature and need to modify names of things (because it's something actively worked on; or maybe there's very good reason to rename globally) there's now no easy/safe way to do it outside of going into every file and every little symbol reference (which could be 100). The use case it removes is far more sensitive and hard to do then the mild convenience it provides. Please revert this change or just add back the old functionality. cc @weswigham |
Sounds like a bug, separate from this suggestion to add this functionality as an optional refactor. @purpledrgn Perhaps open a separate issue or search to see if someone already has? |
But report #29238 (for anyone stumbling on to this problem) |
This can be closed because this is now the default behaviour. It can be disabled with these settings: "typescript.preferences.renameShorthandProperties": false,
"javascript.preferences.renameShorthandProperties": false, |
Search Terms
Suggestion
I want to rename the named import but only within this module.
This is possible via "renamed named imports".
A refactoring could update the import along with any internal references:
I'm happy to help implementing this if other people are interested and someone can guide me. 😄
Checklist
My suggestion meets these guidelines:
The text was updated successfully, but these errors were encountered: