Rename a symbol of a named export: Do not create export alias
See original GitHub issue- VSCode Version: 1.30
- OS Version: Win 10
When I rename a symbol which is a named export in a module, then there is just an alias created in the module export
(VS Code 1.30). What I would expect is that the symbol is renamed in the module export AND all in all modules that are importing it (that is the bevavior of 1.29.1). Or an option by which I can specify the old behavior. This feature is soo useful to rename a bunch of modules.
Release notes of 1.30 only include some rename changes for destructuring , but I did not have any destructuring in code.
Old (1.29.1):
New (1.30):
Does this issue occur when all extensions are disabled?: Yes, running clean versions of 1.30, 1.29.1
PS: Typescript 3.2.2 in both tests.
// EDIT:
Actually, after all VS Code 1.29.1 did use Typescript 3.1.4 in the first test, not 3.2.2. Switching to TS 3.2.2 with the old 1.29.1 version, the same behavior (just aliasing the export instead of renaming in the whole workspace) reoccurs. I am not sure, if there are interdependencies between VS Code and TS and therefore leave the issue open or not?
Issue Analytics
- State:
- Created 5 years ago
- Reactions:28
- Comments:20 (3 by maintainers)
Top GitHub Comments
unckeck the following preferences in settings to make it work:
typescript.preferences.useAliasesForRenames
I’ll second this: a global option for the old behaviour feels necessary. This new
alias
does not work at all with the way some people work and imposing this new “feature” on people for something as common as symbol rename is not nice.I’m sorry but for me the “improved” version is actually felt like a bug that is now preventing me from using renaming all together: I don’t want my codebase to be littered with aliases.
Just let us rename stuff please. Even a rollback of the feature altogether would be better, with an option to opt-in for alias renaming when things are properly figured out.