1
0
mirror of https://github.com/golang/go synced 2024-11-19 00:44:40 -07:00
go/internal/lsp/source
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
..
analysis.go internal/lsp: add more error propagation and logging for analyses 2019-04-24 02:44:48 +00:00
completion_format.go internal/lsp: add additional error handling for builtin packages 2019-05-10 13:52:03 +00:00
completion_snippet.go internal/lsp: fix composite literal completion 2019-05-13 22:24:33 +00:00
completion.go internal/lsp: fix composite literal completion 2019-05-13 22:24:33 +00:00
diagnostics.go internal/lsp: propagate diagnostics for reverse dependencies 2019-05-10 13:52:23 +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: normalise and make public diff<->edit conversions 2019-04-15 20:31:36 +00:00
highlight.go internal/lsp: add support for document highlight 2019-03-26 19:08:20 +00:00
hover.go internal/lsp: add definition support for packages 2019-05-10 15:10:30 +00:00
identifier.go internal/lsp: add definition support for packages 2019-05-10 15:10:30 +00:00
signature_help.go internal/lsp: add definition support for packages 2019-05-10 15:10:30 +00:00
source_test.go internal/lsp: adding the test suite to the source package 2019-05-10 20:20:41 +00:00
symbols.go internal/lsp: make interface methods children of the interface symbol 2019-04-24 02:46:01 +00:00
util.go internal/lsp: add some missing copyright notices 2019-05-11 04:16:17 +00:00
view.go internal/lsp: add definition support for packages 2019-05-10 15:10:30 +00:00