Skip to content

Renaming class name messing up object literal shorthand #76482

@silverwzw

Description

@silverwzw
  • VSCode Version: 1.35.1
  • OS Version: Windows_NT x64 6.1.7601

Steps to Reproduce:

  1. Create a javascript file with the following content:
class A { }
module.export = { A };
  1. Rename the class name:

    • Right click on the class name A.
    • In the right click menu, click Rename Symbol .
    • Rename the class to some other name, say B.
  2. Outcomes

Expected outcome:

class B { }
module.export = { A: B };

Actual outcome:

class B { }
module.export = { B: A };

Note: this only happens if A is used explicitly as class name. If the object literal shorthand property is a variable name, like:
const A = 1; module.export = { A };, or even
const A = class {}; module.export = { A };
Then the rename function works as expected.

Does this issue occur when all extensions are disabled? Yes

Metadata

Metadata

Assignees

Labels

javascriptJavaScript support issuesupstreamIssue identified as 'upstream' component related (exists outside of VS Code)

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions