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

Syntax highlighting of arrow => after upgrade to VS Code 1.70 #1675

Closed
2-5 opened this issue Aug 4, 2022 · 5 comments
Closed

Syntax highlighting of arrow => after upgrade to VS Code 1.70 #1675

2-5 opened this issue Aug 4, 2022 · 5 comments
Labels
bug Something isn't working

Comments

@2-5
Copy link
Contributor

2-5 commented Aug 4, 2022

After today's upgrade of VS Code to 1.70 the syntax highlighting of => in .vue files changed. Also notice the < and > in tags.

Compare .vue with .ts file:

2022-08-05_000235

@James-Laidlaw
Copy link

this looks like the impact of issue #1566, although I believe the upgrade to VS Code 1.70 triggering it may be new information

@jb-qian
Copy link
Contributor

jb-qian commented Aug 5, 2022

open /Users/${username}/.vscode/extensions/vue.volar-0.39.4-darwin-x64/syntaxes/vue.tmLanguage.json

change
"begin": "([a-zA-Z0-9:-]+)\\b(?=[^>]*\\blang\\s*=\\s*(['\"]?)ts\\b\\2)",
to
"begin": "([a-zA-Z0-9:-]+)\\b(?=[^>]*\\blang\\s*=\\s*(['\"]?)\\ts\\b\\2)",
or
"begin": #"([a-zA-Z0-9:-]+)\\b(?=[^>]*\\blang\\s*=\\s*(['\"]?)ts\\b)\\2",

reload vscode(v1.70.0)

it seems that it can be solved temporarily

@veritymedia
Copy link

Its freaking me out too. Thanks for the fix @jb-qian

@hackycy
Copy link

hackycy commented Aug 5, 2022

Its freaking me out too. 😩

@bcurtin144
Copy link

I think the problem is that the TextMate regular expression rules mark the <script lang="ts"> tag itself as TypeScript, at which point VS Code tries to apply bracket pair colorization and gets tripped up on the >, which continues on to other angle bracket symbols, like =>.

I'm definitely not an expert at TextMate, but it would seem that the solution would be to apply TypeScript rules only to what's between the <script lang="ts">...</script> tags, and not the tags themselves.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

7 participants