-
Notifications
You must be signed in to change notification settings - Fork 60
Neovim client: fix semantic tokens #757
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
Neovim client: fix semantic tokens #757
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't remember all the details on top of my head, but the names were selected after trying many themes.
Now we'd need to know that these changes have no effect on those themes.
Can semantic tokens be turned off in neovim until all works? |
yes |
I'm afraid this PR will (from memory but I could be wrong) break some themes. |
It seems not, because This changes the name of the token the server emit, but the Example: previously the token Edit 1: This PR can change colors. If a theme applied a color to the |
I'm going to do some tests. |
Three themes have changed: Monokai Dimmed, Tomorrow Night Blue and One Dark Pro. The changes were in the token Curious that the token |
The token So based on these findings, is it possible to handle the issue on the neovim side? |
In general, I just don't know what the constraints are with neovim. One could also do everything via grammar, which is less precise but avoids breaking things. As long as that extra complexity does not affect the main extension. |
No, because it is necessary to change the name of the token emited by the server. Ideally, the specification would have a name for the token The best approach is to not emit |
That breaks things for 98% of users to benefit 2%? Or maybe I don't understand the suggestion. |
Yes, you are correct. What I'm saying is that the LSP specification should have a token to jsx. I will continue emitting the token, but I will change the token type. |
So this seems to solve the issue. |
I guess a quick check is needed that the other styles still work. |
Yes, I tested it on all themes supported by the extension. |
Fantastic. Thank you so much for sorting this out. Pretty subtle stuff. |
Neovim 0.9 add support for semantic tokens.
When opening a file and editing I get the following error:
E5248: Invalid character in group name
I saw that the server registers tokens that are not in the specification:
support-type-primitive
,jsx-tag
andjsx-lowercase
.This PR change name of tokens:
support-type-primitive
->type
jsx-tag
->class
(class
was used as module name, now it'snamespace
)jsx-lowercase
->interface
(div
,h1
)One question: Why emit a token for
jsx-tag
, the<
and>
in<div>
? Couldn't this be done via regex?Forum post: https://forum.rescript-lang.org/t/neovim-vim-rescript-lsp-semantic-tokens-issue-and-maintenance/4387