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

How to dynamically register semantic tokens #1107

Closed
stamblerre opened this issue Oct 20, 2020 · 7 comments
Closed

How to dynamically register semantic tokens #1107

stamblerre opened this issue Oct 20, 2020 · 7 comments

Comments

@stamblerre
Copy link

I have a few questions about dynamic registration for the semantic tokens methods.

  • Should they each be registered individually? When I register textDocument/semanticTokens/full, textDocument/semanticTokens/full/delta, and textDocument/semanticTokens/range, I get errors for textDocument/semanticTokens/full/delta and textDocument/semanticTokens/range.
  • Should the registration options for each method be the same SemanticTokensOptions? Should full and range be configured in those options or left out since they are registered individually?
@dbaeumer
Copy link
Member

The idea is to have only one registration. This is why SemanticTokensOptions has a property for range and for full. This allows the client to decide which methods it best calls.

Does that make sense?

@dbaeumer dbaeumer added the info-needed Issue requires more information from poster label Oct 21, 2020
@stamblerre
Copy link
Author

It does, but then how should semantic tokens be registered? textDocument/semanticTokens doesn't seem to work when sent in registerCapability.

@dbaeumer
Copy link
Member

Good find. This is actually more a bug in VS Codes implementation which happened when I renamed the requests. Let me have a look there.

@dbaeumer
Copy link
Member

I fixed this in the LSP libraries. In the upcoming next version you can register using textDocument/semanticTokens which will be the correct key. Until then you can use textDocument/semanticTokens/full which was incorrectly used before.

@david-driscoll
Copy link

cc @gundermanc just so you're aware, this will affect the visual studio language client.

@gundermanc
Copy link
Member

cc @gundermanc just so you're aware, this will affect the visual studio language client.

What's the change exactly? AFAIK VS IDE does not yet support dynamic registration of capabilities.

@dbaeumer
Copy link
Member

dbaeumer commented Oct 29, 2020

@gundermanc it only affects dynamic registration. The routes to request semantic tokens are still the same.

gopherbot pushed a commit to golang/vscode-go that referenced this issue Oct 30, 2020
This includes the fix for
microsoft/language-server-protocol#1107. We
need this merged in order to resolve golang/go#42148.

Change-Id: I675b20f24019f590f8c3dbb4257c8414d282de98
Reviewed-on: https://go-review.googlesource.com/c/vscode-go/+/266497
Trust: Rebecca Stambler <rstambler@golang.org>
Trust: Suzy Mueller <suzmue@golang.org>
Run-TryBot: Rebecca Stambler <rstambler@golang.org>
TryBot-Result: kokoro <noreply+kokoro@google.com>
Reviewed-by: Suzy Mueller <suzmue@golang.org>
Reviewed-by: Hyang-Ah Hana Kim <hyangah@gmail.com>
@vscodebot vscodebot bot locked and limited conversation to collaborators Dec 6, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants