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

Block responding to textDocument/semanticTokens until schema is available #343

Open
radeksimko opened this issue Jan 4, 2021 · 1 comment
Labels
enhancement New feature or request textDocument/semanticTokens Semantic syntax highlighting

Comments

@radeksimko
Copy link
Member

Current Version

0.11.0

Use-cases

As mentioned in #331:

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. 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.

Proposal

Another way of resolving this would be also pushing update from the server back to client when we have the schema via workspace/semanticTokens/refresh, but it's questionable whether this is the best use case for that method.

I believe that textDocument/semanticTokens should always attempt to wait for some sensible time until schema is available, or timeout and return no (additional) tokens. This would also avoid the extra roundtrip in most cases.

@radeksimko
Copy link
Member Author

#344 may be better way to resolve this than effectively delay rendering / response, but I'll keep this open until we have at least prototype of #344 to fully understand the UX implications.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request textDocument/semanticTokens Semantic syntax highlighting
Projects
None yet
Development

No branches or pull requests

1 participant