Allow rename aliasing behaviour to be controlled on per-command basis #93501
Labels
feature-request
Request for new features or functionality
javascript
JavaScript support issues
typescript
Typescript support issues
Milestone
VS Code version: 1.43.2
OS: macOS 10.15.4
Originally suggested here: microsoft/TypeScript#29238 (comment)
With regards to TypeScript renames, I understand that VS Code defaults to the safe behaviour of creating aliases where shorthand properties are used (i.e.
javascript.preferences.renameShorthandProperties
andtypescript.preferences.renameShorthandProperties
default totrue
).However, sometimes (not always) I want the rename to apply everywhere—I don't want any aliases to be created. React component props are a good example (microsoft/TypeScript#29238 (comment)):
If I rename the prop
foo
anywhere, inProps
or inComponent
, an alias will be created, but in this specific case I always want the prop to be renamed everywhere (inmapStateToProps
andComponent
).Another example is renaming imports. Sometimes I only want to rename the symbol in this file, which the default behaviour allows me to do (by creating an alias):
… but most of the time I want to rename the symbol everywhere, including at the definition.
I can change the behaviour by flicking the switch—setting
renameShorthandProperties
tofalse
ortrue
depending on what I want at the time—however it's far from a smooth experience if I have to go into my settings to temporarily adjust a setting before executing the rename.Perhaps VS Code could provide two rename commands instead of one, so that the behaviour can be controlled on a per-command basis?
Related:
The text was updated successfully, but these errors were encountered: