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

internal/lsp: disable unimported completions for snippet tests

Turns out that these were already disabled in the
golang.org/x/tools/internal/lsp tests, which is why we only ever save
the failures in golang.org/x/tools/internal/lsp/source tests. Discussing
the reasons that this is necessary on the issue, but I think completion
scoring in general needs to be centralized and documented, so hopefully
we can handle this case as part of that larger fix.

Fixes golang/go#38269

Change-Id: Ie1b615315e417ab8211a3580cf8f27cbdc3b74e4
Reviewed-on: https://go-review.googlesource.com/c/tools/+/227417
Run-TryBot: Rebecca Stambler <rstambler@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Robert Findley <rfindley@google.com>
This commit is contained in:
Rebecca Stambler 2020-04-07 00:03:22 -04:00
parent 066fd1390e
commit a3568bac92

View File

@ -133,6 +133,7 @@ func (r *runner) CompletionSnippet(t *testing.T, src span.Span, expected tests.C
_, list := r.callCompletion(t, src, func(opts *source.Options) { _, list := r.callCompletion(t, src, func(opts *source.Options) {
opts.Placeholders = placeholders opts.Placeholders = placeholders
opts.DeepCompletion = true opts.DeepCompletion = true
opts.UnimportedCompletion = false
}) })
got := tests.FindItem(list, *items[expected.CompletionItem]) got := tests.FindItem(list, *items[expected.CompletionItem])
want := expected.PlainSnippet want := expected.PlainSnippet