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
Class string color scopes incorrect when v-model contains TS "as" cast #520
Comments
This problem similar to #112, it's embed language syntax issue, we can't fix, you need to use |
@johnsoncodehk which upstream package is responsible for this issue? |
@johnsoncodehk adding round parentheses fixes it. It might be interesting for volar to auto-add those inside templates. Should I open a FR for this? |
@mesqueeb you can open a FR, but there is not necessarily a way to do it. |
What issue in https://github.com/microsoft/TypeScript-TmLanguage is the upstream issue for this? It doesn't make sense to have this closed without notifying the upstream repo to fix it. |
Marking any issue as duplicate of this one yet closing it without a proper path to get it fixed is kind of frustrating. How can we further track this issue, maybe over at microsoft/TypeScript-TmLanguage ? |
I think saying this is an upstream issue without pointing to the issue is a little dismissive / frustrating. I don't see, for example, how this can be purely an upstream issue when HTML languages don't have expressions like Vue has. It seems more likely (or at least possible?) that Vue is possibly identifying bound values as the wrong type of expression? That is, if we assume:
If you aren't tracking an issue with Microsoft that has asked them for feedback, can you really prove otherwise? This feels like kicking the can down the road. |
@matthew-dean Even in This is the code where we embed the ts syntax, you can try investigating:
I don't think upstream has a chance to fix it, it's more like a design limitation of the embedded language syntax highlight. |
Example:
Class string is assigned incorrect scopes
meta.namespace.declaration.ts
andsource.ts.embedded.html.vue
etc..The order of attributes seems to make no difference. Workarounds:
v-model="(var as string)"
v-model="<string>var"
How it appears (using tomorrow night theme):
How it should appear:
The text was updated successfully, but these errors were encountered: