tools/internal/lsp/source
Muir Manders 4298585011 internal/lsp: provide deep completion candidates
Deep completion refers to searching through an object's fields and
methods for more completion candidates. For example:

func wantsInt(int) { }
var s struct { i int }
wantsInt(<>)

Will now give a candidate for "s.i" since its type matches the
expected type.

We limit to three deep completion results. In some cases there are
many useless deep completion matches. Showing too many options defeats
the purpose of "smart" completions. We also lower a completion item's
score according to its depth so that we favor shallower options. For
now we do not continue searching past function calls to limit our
search scope. In other words, we are not able to suggest results with
any chained fields/methods after the first method call.

Deep completions are behind the "useDeepCompletions" LSP config flag
for now.

Change-Id: I1b888c82e5c4b882f9718177ce07811e2bccbf22
GitHub-Last-Rev: 26522363730036e0b382a7bcd10aa1ed825f6866
GitHub-Pull-Request: golang/tools#100
Reviewed-on: https://go-review.googlesource.com/c/tools/+/177622
Reviewed-by: Rebecca Stambler <rstambler@golang.org>
Run-TryBot: Rebecca Stambler <rstambler@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
2019-06-27 18:58:03 +00:00
..
analysis.go internal/lsp: update analysis runner for new features 2019-06-14 15:20:01 +00:00
completion.go internal/lsp: provide deep completion candidates 2019-06-27 18:58:03 +00:00
completion_format.go internal/lsp: provide deep completion candidates 2019-06-27 18:58:03 +00:00
completion_snippet.go internal/lsp: provide deep completion candidates 2019-06-27 18:58:03 +00:00
deep_completion.go internal/lsp: provide deep completion candidates 2019-06-27 18:58:03 +00:00
diagnostics.go internal/lsp: plumb suggested fixes through the LSP 2019-06-26 21:02:18 +00:00
diagnostics_test.go internal/span: change URI.Filename so it just returns the filename 2019-06-10 21:39:43 +00:00
enums.go internal/lsp: switch completion item tests to using the enum strings 2019-04-17 17:57:43 +00:00
format.go internal/lsp: remove source.FileContent 2019-06-06 05:02:23 +00:00
highlight.go internal/lsp: separate refactorings out of memoization CL 2019-06-25 16:04:30 +00:00
hover.go internal/lsp: attach documentation to signature help 2019-06-06 17:46:28 +00:00
identifier.go internal/lsp: support a file belonging to multiple packages 2019-06-26 17:56:19 +00:00
references.go internal/lsp: support a file belonging to multiple packages 2019-06-26 17:56:19 +00:00
rename.go internal/lsp/source: move the common path to the left 2019-06-27 17:56:40 +00:00
rename_check.go internal/lsp: separate refactorings out of memoization CL 2019-06-25 16:04:30 +00:00
signature_help.go internal/lsp: fix some issues with trimming ASTs 2019-06-07 20:08:10 +00:00
source_test.go internal/lsp: provide deep completion candidates 2019-06-27 18:58:03 +00:00
suggested_fix.go internal/lsp: plumb suggested fixes through the LSP 2019-06-26 21:02:18 +00:00
suggested_fix_experimental.go internal/lsp: plumb suggested fixes through the LSP 2019-06-26 21:02:18 +00:00
symbols.go internal/lsp: separate refactorings out of memoization CL 2019-06-25 16:04:30 +00:00
util.go internal/lsp: provide deep completion candidates 2019-06-27 18:58:03 +00:00
view.go internal/lsp: plumb suggested fixes through the LSP 2019-06-26 21:02:18 +00:00