-
-
Notifications
You must be signed in to change notification settings - Fork 343
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
self keyword not correctly specified / highlighted #3093
Comments
@tomlau10 no difference with Neovim as far as I can see. The rationale here is that The workaround in Neovim is similar to what you shared: clear the highlight for Disclaimer: I'm not very familiar with LSP Semantic Tokens so I am not even sure whether language servers have a notion of "built-in" tokens. Tree-sitter does, apparently Textmate too. |
Disclaimer: I am not maintainer of LuaLS, nor have rich knowledge related to semantic tokens 🙈
I believe the token types are given by vscode's LSP spec 🤔 You can see that LuaLS also defined TokenType enum in that way: lua-language-server/script/proto/define.lua Lines 142 to 166 in 64c7084
From the above vscode's doc, you can see that semantic token types are always used together with modifier type.
=> all the above are variables but with different attributes (modifier) Can your theme support coloring based on
If you prefer your editor's default highlight, here is another workaround:
|
I know that @lewis6991 is a pro user and lsp client developer in neovim, |
That's what I expected, thanks @tomlau10. Neovim applies higher priorities to types with modifiers, so you can actually be granular, but Your workaround makes sense. In fact it is similar to what I suggested @BigfootN (OP) to do. So to summarize, if semantic tokens aren't expressive enough for the language with regards to syntax highlighting, either:
Issue can be closed, I guess? |
Hello, Sorry for responding so late, and thank you all for all your detailed explanation. Indeed, the workaround @antoineco suggested to me seems to "solve" the problem. So if I understand well, the theme should support this (from @tomlau10 ):
Should I close this issue ? Thank you again for all your precious help |
How are you using the lua-language-server?
NeoVim
Which OS are you using?
Linux
What is the issue affecting?
Other
Expected Behaviour
The
self
word should be highlighted as a keyword and not a variable.Actual Behaviour
The
self
keyword seems to be recognized as a variable and not a keyword. Theself
keyword is not correctly highlighted. It seems highlighted as a variable and not as a keyword.Reproduction steps
Use
neovim
withlua_ls
and open alua
file and a theme with theself
keyword. Theself
keyword is not correctly highlighted.Additional Notes
I first noticed the problem in neovim with the
everforest
theme. I even opened an issue. More context can be found in the author's detailed answer.Log File
No response
The text was updated successfully, but these errors were encountered: