TypeScript icon indicating copy to clipboard operation
TypeScript copied to clipboard

JS object destructuring: allow to shorten expression when assignment is renamed back to original property value

Open undeletable opened this issue 1 year ago • 2 comments

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): vscode-destructuring

Proposed behavior Shorten form of assignment (const { property } = testObject; in this example) - either automatically, or enabled with configuration.

undeletable avatar May 03 '24 19:05 undeletable

Yes, confirm this feature is must have

psnet avatar May 03 '24 21:05 psnet

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.

andrewbranch avatar Oct 17 '24 22:10 andrewbranch