tools/internal/lsp
Muir Manders de15caf068 internal/lsp: fix composite literal completion
Fix the following issues:

- We were trying to complete struct literal field names for
  selector expressions (e.g. "Foo{a.B<>}"). Now we only complete field
  names in this case if the expression is an *ast.Ident.
- We weren't including lexical completions in cases where you might be
  completing a field name or a variable name (e.g. "Foo{A<>}").

I refactored composite literal logic to live mostly in one place. Now
enclosingCompositeLiteral computes all the bits of information related
to composite literals. The expected type, completion, and snippet code
make use of those precalculated facts instead of redoing the work.

Change-Id: I29fc808544382c3c77f0bba1843520e04f38e79b
GitHub-Last-Rev: 3489062be342ab0f00325d3b3ae9ce681df7cf2e
GitHub-Pull-Request: golang/tools#96
Reviewed-on: https://go-review.googlesource.com/c/tools/+/176601
Reviewed-by: Rebecca Stambler <rstambler@golang.org>
Run-TryBot: Rebecca Stambler <rstambler@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
2019-05-13 22:24:33 +00:00
..
browser internal/lsp: add version and bug commands 2019-05-11 04:16:02 +00:00
cache internal/lsp: add some missing copyright notices 2019-05-11 04:16:17 +00:00
cmd internal/lsp: add version and bug commands 2019-05-11 04:16:02 +00:00
diff internal/lsp: normalise and make public diff<->edit conversions 2019-04-15 20:31:36 +00:00
protocol internal/lsp: respond to shutdown requests and add DO NOT EDITs 2019-05-13 17:21:55 +00:00
snippet internal/lsp: introduce snippet builder object 2019-04-25 18:37:29 +00:00
source internal/lsp: fix composite literal completion 2019-05-13 22:24:33 +00:00
testdata internal/lsp: fix composite literal completion 2019-05-13 22:24:33 +00:00
tests internal/lsp: fix composite literal completion 2019-05-13 22:24:33 +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: run source.organizeImports on all codeActions 2019-04-16 21:54:00 +00:00
completion.go internal/lsp: change some comments and variable names in completion code 2019-04-30 00:41:04 +00:00
definition.go internal/lsp: refactor server.go to separate into LSP categories 2019-04-17 20:54:51 +00:00
diagnostics.go internal/lsp: propagate diagnostics for reverse dependencies 2019-05-10 13:52:23 +00:00
format.go internal/lsp: disable rangeFormatting temporarily 2019-05-08 13:53:17 +00:00
general.go internal/lsp: add version and bug commands 2019-05-11 04:16:02 +00:00
highlight.go internal/lsp: refactor server.go to separate into LSP categories 2019-04-17 20:54:51 +00:00
hover.go internal/lsp: support comments on hover for typenames, funcs, fields 2019-04-22 16:38:38 +00:00
info.1.11.go internal/lsp: add version and bug commands 2019-05-11 04:16:02 +00:00
info.go internal/lsp: add version and bug commands 2019-05-11 04:16:02 +00:00
link.go internal/lsp: add document link handling for import paths to godoc 2019-05-03 18:56:57 +00:00
lsp_test.go internal/lsp: support dynamic workspace folder changes 2019-05-10 21:22:50 +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: support dynamic workspace folder changes 2019-05-10 21:22:50 +00:00
signature_help.go internal/lsp: refactor server.go to separate into LSP categories 2019-04-17 20:54:51 +00:00
symbols.go internal/lsp: refactor server.go to separate into LSP categories 2019-04-17 20:54:51 +00:00
text_synchronization.go internal/lsp: add version and bug commands 2019-05-11 04:16:02 +00:00
util.go internal/lsp: add version and bug commands 2019-05-11 04:16:02 +00:00
workspace.go internal/lsp: support dynamic workspace folder changes 2019-05-10 21:22:50 +00:00