Reputation: 7530
VSCode has an option to change/rename variables called editor.action.rename
, usually bound to F2.
However, in Typescript and Javascript, this uses aliases when renaming an imported variable, eg:
import { originalName } from 'my-package'
results in
import { originalName as newName } from 'my-package'
How to prevent this, and propagate the change to all references?
Upvotes: 27
Views: 3977
Reputation: 7530
It is possible to prevent renaming using aliases:
Preferences: Open Settings (JSON)
"javascript.preferences.useAliasesForRenames": false,
"typescript.preferences.useAliasesForRenames": false,
Upvotes: 37