From 63f8a171a61bbd68338d6ef6f3adc90794a765e4 Mon Sep 17 00:00:00 2001 From: Rebecca Stambler Date: Fri, 30 Oct 2020 01:00:52 -0400 Subject: [PATCH] internal/lsp: use the correct method name to register semantic tokens 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 Run-TryBot: Rebecca Stambler gopls-CI: kokoro TryBot-Result: Go Bot Reviewed-by: Peter Weinberger --- internal/lsp/workspace.go | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/internal/lsp/workspace.go b/internal/lsp/workspace.go index 0d0e8a3994..c1ba89b3b1 100644 --- a/internal/lsp/workspace.go +++ b/internal/lsp/workspace.go @@ -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",