1
0
mirror of https://github.com/golang/go synced 2024-11-18 14:54:40 -07:00

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 <rstambler@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Hyang-Ah Hana Kim <hyangah@gmail.com>
This commit is contained in:
Rebecca Stambler 2020-03-20 15:13:56 -04:00
parent 268ba720d3
commit 0d839f3cf2
2 changed files with 1 additions and 14 deletions

View File

@ -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.

View File

@ -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