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

Implement textDocument/semanticTokens (semantic highlighting) #331

Merged
merged 1 commit into from
Jan 4, 2021

Conversation

radeksimko
Copy link
Member

@radeksimko radeksimko commented Dec 7, 2020

I have only implemented the first handler and the protocol allows omitting the rest via capability negotiation, so we can add the other ones later.

Client always sends textDocument/semanticTokens/full almost immediately after didOpen and didChange, which means that we may not have all the schema at that point. workspace/semanticTokens/refresh would enable us to refresh tokens dynamically from the server side as we know more schema, e.g. when terraform version and/or terraform providers schema -json finish. As a result not supporting this call initially may provide occasionally "flickering UX" (colours change as the user types), but the upside is that it can't be any worse than it is, because we are just enriching the highlighting and the static grammar in VSCode extension still provides the base.

Testing requires hashicorp/vscode-terraform#523 on the client side.

Closes #264


Follow-up issues:

@radeksimko radeksimko added enhancement New feature or request textDocument/semanticTokens Semantic syntax highlighting labels Dec 7, 2020
@radeksimko radeksimko force-pushed the f-semantic-tokens branch 7 times, most recently from 05eaa10 to a3e77ca Compare December 9, 2020 17:14
@radeksimko radeksimko marked this pull request as ready for review December 9, 2020 17:23
@radeksimko radeksimko requested a review from a team December 9, 2020 18:45
@ghost
Copy link

ghost commented Feb 3, 2021

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.
If you have found a problem that seems similar to this, please open a new issue and complete the issue template so we can capture all the context necessary to investigate further.

@ghost ghost locked as resolved and limited conversation to collaborators Feb 3, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
enhancement New feature or request textDocument/semanticTokens Semantic syntax highlighting
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Support semantic syntax highlighting
2 participants