1
0
mirror of https://github.com/golang/go synced 2024-10-01 05:28:33 -06:00
go/internal/lsp
Muir Manders da514acc47 internal/lsp: suggest completions that satisfy interfaces
When checking if a completion candidate matches the expected type at
the cursor position, we now use types.AssignableTo instead of
types.Identical. This properly handles cases like using a concrete
type to satisfy an interface type.

Calling AssignableTo triggered some crashes related to the fake
"resolved" types we create. Their underlying type was nil, which is
not allowed. We now set their underlying type to the invalid type.

I've also rearranged things so expected type information lives in a
dedicated typeInference struct. For now there is no new information added,
but in subsequent commits there will be more metadata about the
expected type.

Change-Id: I14e537c548960c30e444cf512a4413d75bb3ee45
GitHub-Last-Rev: 7e64ebe32938562648938d7a480195d954b018f2
GitHub-Pull-Request: golang/tools#116
Reviewed-on: https://go-review.googlesource.com/c/tools/+/182358
Run-TryBot: Rebecca Stambler <rstambler@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Rebecca Stambler <rstambler@golang.org>
2019-06-17 19:08:20 +00:00
..
browser internal/lsp: add version and bug commands 2019-05-11 04:16:02 +00:00
cache internal/lsp/cache: fix ineffectual err assignment 2019-06-17 16:34:45 +00:00
cmd internal/span: change URI.Filename so it just returns the filename 2019-06-10 21:39:43 +00:00
debug cmd/gopls: preparing for v0.1.0 2019-06-12 23:17:17 +00:00
diff internal/lsp/diff: remove redundant memory allocate and copy operations in function 'shortestEditSequence'. 2019-06-17 16:22:25 +00:00
protocol internal/lsp: block rather than reject when the message queue is full 2019-06-14 18:56:17 +00:00
snippet internal/lsp: introduce snippet builder object 2019-04-25 18:37:29 +00:00
source internal/lsp: suggest completions that satisfy interfaces 2019-06-17 19:08:20 +00:00
testdata internal/lsp: suggest completions that satisfy interfaces 2019-06-17 19:08:20 +00:00
tests internal/lsp: suggest completions that satisfy interfaces 2019-06-17 19:08:20 +00:00
xlog internal/lsp: add the ability to log back to the client 2019-04-01 16:22:08 +00:00
code_action.go internal/lsp: add structured layers to the cache 2019-05-16 21:30:38 +00:00
completion.go internal/lsp: fix completion insertion 2019-05-17 18:32:58 +00:00
definition.go internal/lsp: attach documentation to signature help 2019-06-06 17:46:28 +00:00
diagnostics.go internal/lsp: parse filenames only out of go list errors 2019-06-14 19:27:58 +00:00
format.go internal/lsp: add structured layers to the cache 2019-05-16 21:30:38 +00:00
general.go internal/lsp: allow fine-grained control over vet checks 2019-06-10 19:43:59 +00:00
highlight.go internal/lsp: add structured layers to the cache 2019-05-16 21:30:38 +00:00
hover.go internal/lsp: attach documentation to signature help 2019-06-06 17:46:28 +00:00
link.go internal/lsp: build the packages config on demand from proper configuration 2019-05-21 17:12:43 +00:00
lsp_test.go internal/span: change URI.Filename so it just returns the filename 2019-06-10 21:39:43 +00:00
references.go internal/lsp: add find all references 2019-06-10 19:06:22 +00:00
reset_golden.sh internal/lsp: fix definition tests to use golden files 2019-05-10 21:06:55 +00:00
server.go internal/lsp: allow fine-grained control over vet checks 2019-06-10 19:43:59 +00:00
signature_help.go internal/lsp: reply with nil, rather than empty, signature help 2019-06-08 02:21:20 +00:00
symbols.go internal/lsp: add structured layers to the cache 2019-05-16 21:30:38 +00:00
text_synchronization.go internal/lsp: clear diagnostics when all files from a package are closed 2019-06-14 20:56:25 +00:00
util.go internal/span: change URI.Filename so it just returns the filename 2019-06-10 21:39:43 +00:00
workspace.go internal/lsp: build the packages config on demand from proper configuration 2019-05-21 17:12:43 +00:00