Skip to content

VS Code renaming prop bound using same-name shorthand #5017

@markbrockhoff

Description

@markbrockhoff

Vue - Official extension or vue-tsc version

2.1.10

VSCode version

1.95.3

Vue version

3.5.13

TypeScript version

5.6.3

System Info

No response

package.json dependencies

No response

Steps to reproduce

Bind a variable to the prop of a vue component using the same-name shorthand introduced in vue 3.4. E.g.:
image

Now rename the ref using the tools built in to VS Code (shortcut: F2)

What is expected?

I'd expect that renaming the variable bound to the prop would revert to using the normal v-bind syntax so the binding still works like before, just with a new variable name. E.g.:
image

What is actually happening?

At the moment the shorthand is renamed even though due to the name change it's no longer valid. E.g.:
image

Link to minimal reproduction

No response

Any additional comments?

I don't think this should happen as it makes the rename functionality built into VS Code non reliable. Renaming a variable bound using the shorthand would break, or even worse, accidentially bind the value to a different prop.

Metadata

Metadata

Assignees

No one assigned

    Labels

    good reproduction ✨This issue provides a good reproduction, we will be able to investigate it first🔨 p3-minor-bug

    Type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions