go/internal/lsp/testdata/snippets
Muir Manders 7bb39e4ca9 internal/lsp/source: fix default param name generation
When generating a default param name based on a type name, we want to
ignore any package qualifier. For example, if the type is "ast.Node"
we want to generate the variable name "n", so we must ignore the
"ast." qualifier. To do this we use a types.Qualifier that always
returns empty, but qualifyExpr wasn't respecting an empty qualifier
because it is doing manual ast manipulation. However, it seems like
things "just work" if you set a SelectorExpr's "X" to empty
string (i.e. only "Sel" is output when formatting).

Fixes golang/go#42794.

Change-Id: Ied86b9511e4a9550590417c5a506fe35d561d4f9
Reviewed-on: https://go-review.googlesource.com/c/tools/+/275519
Run-TryBot: Muir Manders <muir@mnd.rs>
gopls-CI: kokoro <noreply+kokoro@google.com>
TryBot-Result: Go Bot <gobot@golang.org>
Reviewed-by: Rebecca Stambler <rstambler@golang.org>
Trust: Rebecca Stambler <rstambler@golang.org>
Trust: Robert Findley <rfindley@google.com>
2020-12-07 19:19:02 +00:00
..
literal.go internal/lsp: remove multi-module support in tests 2020-09-22 16:28:30 +00:00
literal.go.golden internal/lsp: remove multi-module support in tests 2020-09-22 16:28:30 +00:00
literal_snippets.go.in internal/lsp/source: fix default param name generation 2020-12-07 19:19:02 +00:00
snippets.go.golden internal/lsp: remove multi-module support in tests 2020-09-22 16:28:30 +00:00
snippets.go.in internal/lsp: remove multi-module support in tests 2020-09-22 16:28:30 +00:00