From 1286b2016bb195031cab5657d3244bc996b3f2dd Mon Sep 17 00:00:00 2001 From: Rebecca Stambler Date: Wed, 13 Mar 2019 20:59:59 -0400 Subject: [PATCH] internal/lsp: filter on insert text, not label Change-Id: Ibd0c0c7af57cc8aeec56188cf52300f7c558adfe Reviewed-on: https://go-review.googlesource.com/c/tools/+/167464 Run-TryBot: Rebecca Stambler Reviewed-by: Ian Cottrell TryBot-Result: Gobot Gobot --- internal/lsp/completion.go | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/internal/lsp/completion.go b/internal/lsp/completion.go index 50f829237a..4785ffa887 100644 --- a/internal/lsp/completion.go +++ b/internal/lsp/completion.go @@ -49,7 +49,8 @@ func toProtocolCompletionItems(candidates []source.CompletionItem, prefix string // This is a hack so that the client sorts completion results in the order // according to their score. This can be removed upon the resolution of // https://github.com/Microsoft/language-server-protocol/issues/348. - SortText: fmt.Sprintf("%05d", i), + SortText: fmt.Sprintf("%05d", i), + FilterText: insertText, } // If we are completing a function, we should trigger signature help if possible. if triggerSignatureHelp && signatureHelpEnabled {