TypeScript
TypeScript copied to clipboard
JS object destructuring: allow to shorten expression when assignment is renamed back to original property value
Current behavior
In a restructuring assignment expression, when alias is renamed back to original property's name, it has the full form (const { property: property } = testObject; in the following example):
Proposed behavior
Shorten form of assignment (const { property } = testObject; in this example) - either automatically, or enabled with configuration.
Yes, confirm this feature is must have
This is not possible with TS Server’s current rename API, but it would be possible in LSP by implementing both textDocument/prepareRename and textDocument/rename.