Skip to content

Commit

Permalink
internal/lsp: use the correct method name to register semantic tokens
Browse files Browse the repository at this point in the history
Leave the legacy names to handle old versions of the VS Code language
client.

Updates golang/go#42148

Change-Id: Ia3eeef9e792e502c5c8018698b9c0ea3a9b0dfe5
Reviewed-on: https://go-review.googlesource.com/c/tools/+/266479
Trust: Rebecca Stambler <rstambler@golang.org>
Run-TryBot: Rebecca Stambler <rstambler@golang.org>
gopls-CI: kokoro <noreply+kokoro@google.com>
TryBot-Result: Go Bot <gobot@golang.org>
Reviewed-by: Peter Weinberger <pjw@google.com>
  • Loading branch information
stamblerre committed Oct 30, 2020
1 parent 2feb2bb commit 63f8a17
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions internal/lsp/workspace.go
Original file line number Diff line number Diff line change
Expand Up @@ -91,9 +91,15 @@ func (s *Server) didChangeConfiguration(ctx context.Context, _ *protocol.DidChan
return nil
}

// This is a work-around for
// https://github.com/microsoft/language-server-protocol/issues/1107. Once
// https://golang.org/cl/266497 has been released for ~1 month, we can probably
// remove this function and use the only correct method name, which is
// "textDocument/semanticTokens".
func semanticTokenRegistrations() []protocol.Registration {
var registrations []protocol.Registration
for _, method := range []string{
"textDocument/semanticTokens",
"textDocument/semanticTokens/full",
"textDocument/semanticTokens/full/delta",
"textDocument/semanticTokens/range",
Expand Down

0 comments on commit 63f8a17

Please sign in to comment.