-
Notifications
You must be signed in to change notification settings - Fork 185
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
Error diagnostic highlight doesn't appear with semantic highlighting enabled #1934
Comments
I believe that is a consequence from appending the modifier to the semantic token scope in Line 117 in de0ef67
lsp_variable.parameter.lsp meta.semantic-token.parameter.declaration.lsp .
But when we initialize the region keys, we use only the scopes defined in our predefined mapping: Line 118 in de0ef67
For this case we don't have a special scope defined, only for "parameter" token without any modifier: Line 131 in de0ef67
I'm not sure how this can be solved in a general way, because we don't know beforehand which of the possible combinations of token types & modifiers the server will use. It might work to add all possible combinations of token types & modifiers which were announced by the server, but that would also mean a lot of unnecessary region keys. As a quick solution, you can explicitly declare this token with a scope in LSP-typescript.sublime-settings, for example {
"semantic_tokens": {
"parameter.declaration": "variable.parameter.lsp"
}
} Then the corresponding region key will also be initialized. I've tested it a few times with this adjustment, and it seems to work most of the time - but for some reason still not everytime reliably. Hm, maybe there is still some unknown behavior of the region draw order by ST, that we didn't consider yet. As a sidenote, I found an unrelated bug that we forgot to lowercase the scope name when initializing the region keys, so the don't necessarily match in a few cases. |
Thanks for the explanation. I would maybe use the workaround for now but I guess the same issue could apply to other types of tokens. |
It seems that it's still broken, or that there's been a regression. The yellow squiggly line and the blue dotted line should underline Environment (please complete the following information) |
Feel free to create a new issue with reproduction steps. |
Describe the bug
With LSP-typescript and semantic highlighting enabled, I often notice that the error highlighting don't show up in the document if a token is also highlighted by semantic highlighting.
To Reproduce
Steps to reproduce the behavior:
Screenshots
The
hint
word is not marked with a squiggly line:Environment (please complete the following information):
The text was updated successfully, but these errors were encountered: