-
Notifications
You must be signed in to change notification settings - Fork 18.4k
Closed
Labels
FrozenDueToAgeNeedsFixThe path to resolution is known, but the work has not been done.The path to resolution is known, but the work has not been done.goplsIssues related to the Go language server, gopls.Issues related to the Go language server, gopls.release-blocker
Milestone
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
Metadata
Metadata
Assignees
Labels
FrozenDueToAgeNeedsFixThe path to resolution is known, but the work has not been done.The path to resolution is known, but the work has not been done.goplsIssues related to the Go language server, gopls.Issues related to the Go language server, gopls.release-blocker