Skip to content

Refactoring to convert destructuring declaration to property accesses #30996

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
mjbvz opened this issue Apr 17, 2019 · 1 comment
Open

Refactoring to convert destructuring declaration to property accesses #30996

mjbvz opened this issue Apr 17, 2019 · 1 comment
Labels
Awaiting More Feedback This means we'd like to hear from more people who would be helped by this feature Domain: Refactorings e.g. extract to constant or function, rename symbol Suggestion An idea for TypeScript

Comments

@mjbvz
Copy link
Contributor

mjbvz commented Apr 17, 2019

From microsoft/vscode#72502

Feature request
Add a refactoring that converts a destructured local to normal propery access:

const {x, y, z} = someObject;
console.log(x + y * z);

Would be converted to:

const newLocal = someObject;
console.log(newLocal.x + newLocal.y * newLocal.z);

We would want to also trigger a rename on newLocal, similar to how the extract refactorings work

This would be the inverse refactoring of #25946

@DanielRosenwasser DanielRosenwasser added Domain: Refactorings e.g. extract to constant or function, rename symbol Suggestion An idea for TypeScript labels Apr 17, 2019
@RyanCavanaugh RyanCavanaugh added the Awaiting More Feedback This means we'd like to hear from more people who would be helped by this feature label Apr 17, 2019
@Kingwl
Copy link
Contributor

Kingwl commented Apr 19, 2019

Related: #29917

@Kingwl Kingwl mentioned this issue Aug 19, 2020
14 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Awaiting More Feedback This means we'd like to hear from more people who would be helped by this feature Domain: Refactorings e.g. extract to constant or function, rename symbol Suggestion An idea for TypeScript
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants