vuejs / language-tools

⚡ High-performance Vue language tooling based-on Volar.js
https://marketplace.visualstudio.com/items?itemName=Vue.volar
MIT License
5.63k stars 378 forks source link

VScode syntax highlighting goes haywire #4272

Open thany opened 3 months ago

thany commented 3 months ago

At some point, the syntax highlighting just goes completely nuts. It doesn't usually take much encouragement to trigger this issue. Sometimes it's literally one letter, other times it needs a bit more of a push.

I've most notably seen this happen with more complex .vue component files, using the Options API.

Here's an example:

image

If I reload the window, or just restart VScode, it goes back the way it's intended:

image

It's worth mentioning the syntax highlighting part for script part also goes awry. Same conditions - usually all it takes is one or a few changed characters. Strangely, the style part seems okay. So far.

I should also emphasise that the above screenshots are an example. It's fairly random in terms of how the syntax highlighting stuffs up, and it feels like it goes stranger and stranger the more I edit without reloading VScode.

I have not seen this happening with any other type of file, among with are plain javascript and typescript files, plain scss, and plain html files.

VScode is at version 1.88.1 and the "Vue - Official" extension is at 2.0.8 2.0.12. I Do NOT have the old Vetur or Volar extensions installed.

k983551019 commented 3 months ago

2.0.6 yes

johnsoncodehk commented 3 months ago

2.0.8 is outdated, please use v2.0.12.

thany commented 3 months ago

I would love to use 2.0.12, but for some reason my VScode refuses to update the extension. Says everything is up to date. I just uninstalled and reinstalled the Vue extension, but now it's at 2.0.10 for whatever (other) reason 🤨

so1ve commented 3 months ago

@thany See https://github.com/vuejs/language-tools/issues/4227

thany commented 3 months ago

I installed 2.0.12 manually. Problem is not fixed yet.

Shyam-Chen commented 3 months ago

image

thany commented 3 months ago

@Shyam-Chen Can you explain what you mean?

Shyam-Chen commented 3 months ago

@thany There are two "Vue - Official" extensions on the VS Code marketplace.

thany commented 3 months ago

Yes, one is 2.0.10 and the other is 2.0.12.

I'm not sure what to do with your comment, since I already said I've installed 2.0.12.

Shyam-Chen commented 3 months ago

I also installed 2.0.12, but I didn't encounter this issue. However, I disabled Deno and Svelte. And updated UnoCSS to 0.59.2.

thany commented 3 months ago

Well then, don't break it, I guess 😀

What is the best way to diagnose this issue and give more information that may lead towards a fix or workaround?

thany commented 2 months ago

Again, kindly asking what information I should bring in, in order to come to a resolution?

Just for reference, here's another fun one:

image

And it goes randomly different for each character changed, for funsies I guess 😀