Skip to content

Refactoring to convert destructuring declaration to property accesses #30996

Open
@mjbvz

Description

@mjbvz

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    Awaiting More FeedbackThis means we'd like to hear from more people who would be helped by this featureDomain: Refactoringse.g. extract to constant or function, rename symbolSuggestionAn idea for TypeScript

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions