Navigation Menu

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

Highlight issue on <script> tag #1566

Closed
leonardssh opened this issue Jul 12, 2022 · 8 comments
Closed

Highlight issue on <script> tag #1566

leonardssh opened this issue Jul 12, 2022 · 8 comments
Labels
bug Something isn't working

Comments

@leonardssh
Copy link
Contributor

> & < shouldn't be red.

image

@leonardssh
Copy link
Contributor Author

leonardssh commented Jul 12, 2022

I've found the issue, apparently that red arrows highlight appears when lang="ts".

lang="ts"
image

lang="js"
image

no lang
image

@LoiLock
Copy link

LoiLock commented Jul 13, 2022

Does this work?

<script lang="ts" setup>
</script>

@leonardssh
Copy link
Contributor Author

leonardssh commented Jul 13, 2022

Does this work?

<script lang="ts" setup>
</script>

Nope, it was the first thing I tried, to no avail.

@LeanderD
Copy link

LeanderD commented Jul 25, 2022

I have a similar problem and I'm not sure it's this extension that's causing it.

For me it looks like this:
Screen Shot 2022-07-25 at 11 33 32

And:
Screen Shot 2022-07-25 at 11 39 28

If I remove lang="ts" or change it to lang="js" the syntax highlighting is correct.

Going back to an older version of this extension isn't fixing it either, disabling VSCode's bracket pair colorization does...
(I went back to a version from two months ago. The issue is quite recent and was still there with the older versions)

Update
I ran Extension Bisect and this is the result:
Screen Shot 2022-07-25 at 11 57 36

So at least for me it's safe to say it's not this extension.
@leonardssh Maybe you can run the extension bisect as well. (command palettte -> Help: Start Extension Bisect)

Hope this helps!

@leonardssh
Copy link
Contributor Author

@LeanderD You've right, the issue doesn't come from the Volar extension, its an issue with vscode bracket pair colorization. Thanks! I think I can close this issue, during its not a valid one.

@JohnCampionJr
Copy link

This has been marked as an extension problem by the VS Code team. Seems the beginning and ending tags are being returned as two different language types.

microsoft/vscode#156168 (comment)

@tujianglin
Copy link

The question is <script lang="ts”> ; The resulting parentheses have a different color. It has nothing to do with Volar. Does anyone know the solution

@James-Laidlaw
Copy link

James-Laidlaw commented Aug 5, 2022

@jb-qian found a temporary solution in the other issue thread for this problem (#1675 ) (we should probably close one of them by the way)

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

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