go/internal/lsp/testdata
Muir Manders ffc70b9ac1 lsp/completion: fix ranking of *types.PkgName candidates
In Go 1.18 types.AssignableTo() started reporting that an invalid type
is assignable to any interface. *types.PkgName (i.e. an import at the
top of the file) has an invalid type for its Type(), so we started
thinking all in scope imports were great candidates when the expected
type was an interface.

Fix by wrapping the AssignableTo (and AssertableTo) to explicitly
return false if either operand is invalid.

Updates golang/go#53595

Change-Id: Ie5a84b7f410ff5c73c6b7870e052bafaf3e21e99
Reviewed-on: https://go-review.googlesource.com/c/tools/+/415595
Reviewed-by: Hyang-Ah Hana Kim <hyangah@gmail.com>
Reviewed-by: Robert Findley <rfindley@google.com>
Run-TryBot: Robert Findley <rfindley@google.com>
TryBot-Result: Gopher Robot <gobot@golang.org>
gopls-CI: kokoro <noreply+kokoro@google.com>
2022-07-01 14:13:48 +00:00
..
%percent
addimport internal/lsp: add list_known_packages and add_import commands 2021-05-23 03:57:00 +00:00
address lsp/completion: reorganize how we track candidate type mods 2021-06-09 15:58:13 +00:00
analyzer tools: make printf analysis have more helpful output 2021-05-21 23:19:31 +00:00
anon
append lsp/completion: reorganize how we track candidate type mods 2021-06-09 15:58:13 +00:00
arraytype lsp/completion: offer candidates converting arrays to slices 2021-04-22 04:15:51 +00:00
assign internal/lsp/source: omit assign stmt LHS in RHS completion 2020-12-07 20:43:33 +00:00
bad
badstmt
bar
basiclit internal/lsp: add support for hovering runes 2021-09-14 22:22:34 +00:00
baz
builtins internal/lsp/completion: fix untyped int type inference 2021-02-05 20:20:24 +00:00
callhierarchy internal/lsp: include function literals in outgoing call hierarchy 2021-06-01 22:58:04 +00:00
casesensitive
cast
cgo internal/lsp: add support for hovering runes 2021-09-14 22:22:34 +00:00
cgoimport internal/lsp: add support for hovering runes 2021-09-14 22:22:34 +00:00
channel
codelens
comment_completion
complit lsp/completion: reorganize how we track candidate type mods 2021-06-09 15:58:13 +00:00
constant
danglingstmt
deep lsp/completion: fix ranking of *types.PkgName candidates 2022-07-01 14:13:48 +00:00
errors
extract internal/lsp: adjust extract function range if block statement 2021-10-22 02:18:41 +00:00
fieldlist
fillstruct internal/lsp: fix fillstruct for structs with unsafe.Pointer 2022-05-05 17:08:12 +00:00
folding internal/lsp: foldable multiline strings 2022-01-04 20:54:25 +00:00
foo
format
func_rank internal/lsp/source: descend into fields and field lists in qualifyExpr 2022-03-25 15:26:50 +00:00
funcsig
funcvalue
fuzzymatch
generate
generated
godef internal/lsp/source: include builtin name in hovered signature 2022-03-24 20:26:13 +00:00
good internal/lsp/source: make it an error to rename embedded fields 2021-01-26 13:52:46 +00:00
highlights
implementation
importedcomplit
imports
index internal/lsp/completion: fix untyped int type inference 2021-02-05 20:20:24 +00:00
inlay_hint internal/lsp: add inlay hints for inferred type params 2022-06-21 17:15:02 +00:00
interfacerank
keywords
labels
links
maps lsp/completion: reorganize how we track candidate type mods 2021-06-09 15:58:13 +00:00
missingfunction internal/lsp/analysis: move implementmissing logic into undeclared 2021-09-28 22:17:57 +00:00
multireturn lsp/completion: fix variadic param candidate ordering edge case 2021-06-01 17:02:03 +00:00
nested_complit
nodisk
noparse
noparse_format
printf
rank lsp/completion: reorganize how we track candidate type mods 2021-06-09 15:58:13 +00:00
references internal/lsp: find references for ident before selector 2021-08-02 19:06:04 +00:00
rename internal/lsp/source: move doc links to the bottom of hover 2022-03-18 13:39:41 +00:00
selector
semantic internal/lsp: add semantic tokens for arrows in declarations 2022-04-07 14:52:22 +00:00
signature internal/lsp/source: move doc links to the bottom of hover 2022-03-18 13:39:41 +00:00
snippets internal/lsp: add snippet completion for function type parameters 2022-03-09 15:55:38 +00:00
statements internal/lsp: add snippet completion for t.Fatal errs 2021-03-15 21:39:02 +00:00
stub internal/lsp/analysis/stubmethods: recognize *ast.CallExpr 2022-05-17 17:04:34 +00:00
suggestedfix
symbols
testy
typdef internal/lsp/source: support typeDefinition for function/method's return values 2021-05-06 03:15:21 +00:00
typeassert lsp/completion: reorganize how we track candidate type mods 2021-06-09 15:58:13 +00:00
typeerrors
typemods lsp/completion: support completing to Elem() types 2021-06-09 15:58:30 +00:00
typeparams lsp/completion: fix func literals with type params 2022-04-26 14:19:52 +00:00
types
undeclared
unimported
unresolved
unsafe internal/lsp: update unsafe completion test for upcoming spec changes 2021-04-22 02:57:26 +00:00
variadic
workspacesymbol internal/lsp: precompute workspace symbols 2021-08-09 20:20:17 +00:00
summary.txt.golden lsp/completion: fix ranking of *types.PkgName candidates 2022-07-01 14:13:48 +00:00
summary_go1.18.txt.golden lsp/completion: fix ranking of *types.PkgName candidates 2022-07-01 14:13:48 +00:00