Closed
Description
@neild reports that neovim with gopls at master produces an error similar to neovim/neovim#21387. I suspect https://go.dev/cl/577655 introduced a shortcut path with a nil Data slice. This patch appears to be an effective workaround:
diff --git a/gopls/internal/server/semantic.go b/gopls/internal/server/semantic.go
index ca3df78e10..7f7a3474d3 100644
--- a/gopls/internal/server/semantic.go
+++ b/gopls/internal/server/semantic.go
@@ -38,7 +38,7 @@ func (s *server) semanticTokens(ctx context.Context, td protocol.TextDocumentIde
// Previously, an error was returned here to achieve the same effect, but
// that had the side effect of very noisy "semantictokens are disabled"
// logs on every keystroke.
- return new(protocol.SemanticTokens), nil
+ return &protocol.SemanticTokens{Data: []uint32{}}, nil