-
Notifications
You must be signed in to change notification settings - Fork 135
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
Different semantic tokens for invalid references #805
Comments
Other plugins (in this case Azure ARM Tools) do it with a squiggly underline like seen in the screenshot: Some decoration like this screams at a user: "There's a problem!", personally I like this and see this behavior in multiple plugins. |
@Rabattkarte Yes, this looks like diagnostics and we plan to do this via diagnostics. I think the question here was whether we could also leverage the semantic highlighting. In retrospect - maybe it's stretching what semantic highlighting is designed for - at least with the current feature set. I'm assuming that diagnostics are pretty much always supported by the client - as it's quite an essential part of LSP - so maybe we just end up adding that to the list in hashicorp/hcl-lang#57 |
The only method syntax/semantic tokens have to indicate 'invalid' is a red color which, in addition to being problematic for color-blind users, does not give any information for why it's invalid. We won't be able to do squiggly lines or text to say why the thing is incorrect. This is truly where diagnostic warning and errors shine, so the effort is better spent in hashicorp/hcl-lang#57 |
I'm going to close this issue as there's nothing we can immediately in terms of semantic highlighting do and it's also unclear whether we should. hashicorp/hcl-lang#57 covers alternative solution involving diagnostics. On the note of the clarity I opened microsoft/language-server-protocol#1415 upstream |
I'm going to lock this issue because it has been closed for 30 days ⏳. This helps our maintainers find and focus on the active issues. |
After updating the highlighting of constant keywords in hashicorp/syntax#24, semantic tokens should take care of highlighting broken references.
Use-cases
It would be helpful to get feedback when referencing a not-defined variable (or similar item).
Proposal
Instead of highlighting the
var
keyword differently (see screenshot above), it is proposed to change the highlighting of the reference name. In the example above,non_existing
should be highlighted differently.The text was updated successfully, but these errors were encountered: