Skip to content
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

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

Open
markbrockhoff opened this issue Nov 21, 2024 · 0 comments
Open

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

markbrockhoff opened this issue Nov 21, 2024 · 0 comments
Labels
bug Something isn't working good reproduction ✨ This issue provides a good reproduction, we will be able to investigate it first 🔨 p3-minor-bug

Comments

@markbrockhoff
Copy link

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.

@KazariEX KazariEX added bug Something isn't working good reproduction ✨ This issue provides a good reproduction, we will be able to investigate it first 🔨 p3-minor-bug and removed pending triage labels Nov 21, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working good reproduction ✨ This issue provides a good reproduction, we will be able to investigate it first 🔨 p3-minor-bug
Projects
None yet
Development

No branches or pull requests

2 participants