Skip to content

Incorrect rename refactoring in object destructuring #62913

@dbaeumer

Description

@dbaeumer

🔎 Search Terms

rename refactoring object destructuring

🕗 Version & Regression Information

  • This changed between versions ______ and _______
  • This changed in commit or PR _______
  • This is the behavior in every version I tried, and I reviewed the FAQ for entries about _________
  • I was unable to test this on prior versions because _______

⏯ Playground Link

No response

💻 Code

interface IInterface {
	diagnostics: string[],
}

const inter: IInterface = { diagnostics: ["Test"] };
const { lintDiagnostics } = inter;
console.log(lintDiagnostics);
  • put cursor into lintDiagnostics inside const { lintDiagnostics } = inter;
  • execute rename refactoring and pick diagnostics as a new name

🙁 Actual behavior

Observe you get

interface IInterface {
	diagnostics: string[],
}

const inter: IInterface = { diagnostics: ["Test"] };
const { lintDiagnostics: diagnostics } = inter;
console.log(diagnostics);

🙂 Expected behavior

You get this:

interface IInterface {
	diagnostics: string[],
}

const inter: IInterface = { diagnostics: ["Test"] };
const { diagnostics } = inter;
console.log(diagnostics);

Additional information about the issue

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions