1
0
mirror of https://github.com/golang/go synced 2024-11-18 16:54:43 -07:00
go/internal/lsp/testdata
Muir Manders c6e1543aba internal/lsp: add struct literal field snippets
Now when you accept a struct literal field name completion, you will
get a snippet that includes the colon, a tab stop, and a comma if
the literal is multi-line. If you have "gopls.usePlaceholders"
enabled, you will get a placeholder with the field's type as well.

I pushed snippet generation into the "source" package so ast and type
info is available. This allows for smarter, more context aware snippet
generation. For example, this let me fix an issue with the function
snippets where "foo<>()" was completing to "foo(<>)()". Now we don't
add the function call snippet if the position is already in a CallExpr.

I also added a new "Insert" field to CompletionItem to store the plain
object name. This way, we don't have to undo label decorations when
generating the insert text for the completion response. I also changed
"filterText" to use this "Insert" field since you don't want the
filter text to include the extra label decorations.

Fixes golang/go#31556

Change-Id: I75266b2a4c0fe4036c44b315582f51738e464a39
GitHub-Last-Rev: 1ec28b2395c7bbe748940befe8c38579f5d75f61
GitHub-Pull-Request: golang/tools#89
Reviewed-on: https://go-review.googlesource.com/c/tools/+/173577
Run-TryBot: Rebecca Stambler <rstambler@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Rebecca Stambler <rstambler@golang.org>
2019-04-29 17:59:36 +00:00
..
analyzer internal/lsp: fix badly formatted error messages from go vet 2019-04-16 19:41:54 +00:00
anon internal/lsp: add additional tests for completion 2018-12-19 22:27:14 +00:00
bad internal/lsp: connect basic analysis functionality 2019-02-06 21:48:25 +00:00
badstmt internal/lsp: handle completion after defer, go statements 2019-04-24 22:01:01 +00:00
bar internal/lsp: suppress more completions in comments and literals 2019-04-24 20:52:08 +00:00
basiclit internal/lsp: suppress more completions in comments and literals 2019-04-24 20:52:08 +00:00
baz internal/lsp: suppress more completions in comments and literals 2019-04-24 20:52:08 +00:00
builtins internal/lsp: add a test for completion of builtin types and functions 2019-01-16 00:24:28 +00:00
cast internal/lsp: add more testdata for completion and diagnostics 2018-11-20 06:06:34 +00:00
comments internal/lsp: suppress more completions in comments and literals 2019-04-24 20:52:08 +00:00
complit internal/lsp: improve composite literal completion 2019-04-23 22:28:03 +00:00
errors internal/lsp: add additional tests for completion 2018-12-19 22:27:14 +00:00
foo internal/lsp: handle shadowed variables in lexical completions 2019-04-25 22:28:32 +00:00
format internal/lsp: add the format command line 2019-04-25 22:22:32 +00:00
func_rank internal/lsp: rank types higher when completing in return of a function 2019-02-02 23:51:57 +00:00
godef internal/lsp: handle embedded struct pointer definitions 2019-04-20 18:18:00 +00:00
good internal/lsp: connect basic analysis functionality 2019-02-06 21:48:25 +00:00
highlights internal/lsp: add support for document highlight 2019-03-26 19:08:20 +00:00
nested_complit internal/lsp: improve composite literal completion 2019-04-23 22:28:03 +00:00
nodisk internal/lsp: a cleaner way of doing overlays 2019-04-17 21:35:05 +00:00
noparse internal/lsp: connect basic analysis functionality 2019-02-06 21:48:25 +00:00
noparse_format internal/lsp: add the format command line 2019-04-25 22:22:32 +00:00
rank internal/lsp: add additional tests for completion 2018-12-19 22:27:14 +00:00
selector internal/lsp: add more testdata for completion and diagnostics 2018-11-20 06:06:34 +00:00
signature internal/lsp: improve composite literal completion 2019-04-23 22:28:03 +00:00
snippets internal/lsp: add struct literal field snippets 2019-04-29 17:59:36 +00:00
symbols internal/lsp: make interface methods children of the interface symbol 2019-04-24 02:46:01 +00:00
testy internal/lsp: connect basic analysis functionality 2019-02-06 21:48:25 +00:00
types internal/lsp: add more testdata for completion and diagnostics 2018-11-20 06:06:34 +00:00