Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
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>
- Loading branch information