From 0d839f3cf2ed7d63fd98875ea3589e5bf4b64de7 Mon Sep 17 00:00:00 2001 From: Rebecca Stambler Date: Fri, 20 Mar 2020 15:13:56 -0400 Subject: [PATCH] internal/lsp: remove completion commands The next version of VS Code Go has to be released before this can be released. Fixes golang/go#37966 Change-Id: I6b97f2a3ff9c8400ae85b815d8bf83a9b12b1069 Reviewed-on: https://go-review.googlesource.com/c/tools/+/224518 Run-TryBot: Rebecca Stambler TryBot-Result: Gobot Gobot Reviewed-by: Hyang-Ah Hana Kim --- internal/lsp/cmd/capabilities_test.go | 6 +----- internal/lsp/completion.go | 9 --------- 2 files changed, 1 insertion(+), 14 deletions(-) diff --git a/internal/lsp/cmd/capabilities_test.go b/internal/lsp/cmd/capabilities_test.go index 02f7fab828..aebed67e7a 100644 --- a/internal/lsp/cmd/capabilities_test.go +++ b/internal/lsp/cmd/capabilities_test.go @@ -130,15 +130,11 @@ func TestCapabilities(t *testing.T) { t.Fatal(err) } for _, item := range list.Items { - // We expect the "editor.action.triggerParameterHints" command for functions and methods. - if item.Kind == protocol.MethodCompletion || item.Kind == protocol.FunctionCompletion { - continue - } // All other completion items should have nil commands. // An empty command will be treated as a command with the name '' by VS Code. // This causes VS Code to report errors to users about invalid commands. if item.Command != nil { - t.Errorf("unexpected command for non-function completion item") + t.Errorf("unexpected command for completion item") } // The item's TextEdit must be a pointer, as VS Code considers TextEdits // that don't contain the cursor position to be invalid. diff --git a/internal/lsp/completion.go b/internal/lsp/completion.go index 0c3cc97795..cd94bbf0b4 100644 --- a/internal/lsp/completion.go +++ b/internal/lsp/completion.go @@ -119,15 +119,6 @@ func toProtocolCompletionItems(candidates []source.CompletionItem, rng protocol. Preselect: i == 0, Documentation: candidate.Documentation, } - // Trigger signature help for any function or method completion. - // This is helpful even if a function does not have parameters, - // since we show return types as well. - switch item.Kind { - case protocol.FunctionCompletion, protocol.MethodCompletion: - item.Command = &protocol.Command{ - Command: "editor.action.triggerParameterHints", - } - } items = append(items, item) } return items