1
0
mirror of https://github.com/golang/go synced 2024-10-01 18:28:32 -06:00
go/internal/lsp/testdata
Muir Manders 920acffc3e internal/lsp: fix bad *ast.ArrayTypes for completion
Currently array and slice literals don't work very well for
completion. When go/parser is not expecting a type, it often turns
array types (e.g. "[]int") into *ast.BadExpr, which messes up
completion because we can't figure out the prefix from *ast.BadExpr,
and *ast.BadExprs don't get type checked.

This change addresses the first problem of not being able to figure
out the prefix. If we see an *ast.BadExpr, we now blindly try to
reparse it as a composite literal by adding on "{}". If we end up with
an *ast.CompositeLit with an *ast.ArrayType "Type", we swap
the *ast.BadExpr for the *ast.ArrayType. This approach is dumb but
simple, and fixes lexical completions in array types.

Change-Id: Ifa42e646bcbf2a30170d73e6dd11982384d40b43
Reviewed-on: https://go-review.googlesource.com/c/tools/+/197437
Run-TryBot: Rebecca Stambler <rstambler@golang.org>
Reviewed-by: Rebecca Stambler <rstambler@golang.org>
2019-10-17 20:53:01 +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
arraytype internal/lsp: fix bad *ast.ArrayTypes for completion 2019-10-17 20:53:01 +00:00
bad internal/lsp: add a test to make sure we handle bad imports 2019-10-17 20:52:05 +00:00
badstmt internal/lsp: fix infinite recursion while fixing AST 2019-09-19 16:27:28 +00:00
bar internal/lsp: fix documentation for completion items 2019-08-12 17:13:29 +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: omit "iota" completion outside const decls 2019-09-15 20:16:06 +00:00
casesensitive internal/lsp: provide option for case sensitive completion 2019-09-26 16:59:42 +00:00
cast internal/lsp: add more testdata for completion and diagnostics 2018-11-20 06:06:34 +00:00
channel internal/lsp: apply type modifiers to completion candidate 2019-06-19 20:27:14 +00:00
comments internal/lsp: suppress more completions in comments and literals 2019-04-24 20:52:08 +00:00
complit internal/lsp/source: fixes completion for slice literals of pointers 2019-08-30 17:14:47 +00:00
constant internal/lsp: remove constant value from label and add tests 2019-05-15 19:19:14 +00:00
deep internal/lsp: search for deep completions across function calls 2019-10-17 03:50:25 +00:00
errors internal/lsp: match completions case-insensitively 2019-06-28 03:43:36 +00:00
fieldlist internal/lsp: improve completions in *ast.FieldList 2019-09-25 22:58:16 +00:00
folding internal/lsp: fix regeneration of golden files 2019-09-25 13:16:59 +00:00
foo internal/lsp: fix bad *ast.ArrayTypes for completion 2019-10-17 20:53:01 +00:00
format internal/lsp: change the unified diff tests to be less fragile 2019-09-27 19:13:25 +00:00
func_rank internal/lsp: move function signature into detail instead of label 2019-07-03 21:07:46 +00:00
funcsig internal/lsp: fix scope of FuncType completion candidates 2019-09-25 19:53:33 +00:00
funcvalue internal/lsp: move function signature into detail instead of label 2019-07-03 21:07:46 +00:00
fuzzy internal/lsp: reorganize completion tests 2019-09-24 17:09:08 +00:00
generated internal/lsp: show "do not edit" message when user opens generated file 2019-08-07 16:44:42 +00:00
godef internal/lsp: add constant values to hovers 2019-09-28 23:04:22 +00:00
good internal/lsp: remove duplicated enums 2019-09-25 15:30:23 +00:00
highlights internal/lsp: add support for document highlight 2019-03-26 19:08:20 +00:00
importedcomplit internal/lsp: fix composite literal completion 2019-05-13 22:24:33 +00:00
imports internal/lsp: fix regeneration of golden files 2019-09-25 13:16:59 +00:00
index internal/lsp: handle more expected type cases 2019-05-16 16:26:11 +00:00
interfacerank internal/lsp: apply type modifiers to completion candidate 2019-06-19 20:27:14 +00:00
labels internal/lsp: add label completion candidates 2019-10-16 23:06:01 +00:00
links internal/lsp: add links search in comments and string literals 2019-07-12 18:53:41 +00:00
nested_complit internal/lsp: add literal completion candidates 2019-09-18 17:13:17 +00:00
nodisk internal/lsp/testdata: delete nodisk/newdisk_exists.go 2019-08-06 20:59:09 +00:00
noparse internal/lsp: connect basic analysis functionality 2019-02-06 21:48:25 +00:00
noparse_format internal/lsp: change the unified diff tests to be less fragile 2019-09-27 19:13:25 +00:00
rank internal/lsp: improve completion support for untyped constants 2019-07-03 16:30:32 +00:00
references internal/lsp: fix declarations in references 2019-09-05 03:51:44 +00:00
rename internal/lsp: change the unified diff tests to be less fragile 2019-09-27 19:13:25 +00:00
selector internal/lsp: move function signature into detail instead of label 2019-07-03 21:07:46 +00:00
signature internal/lsp: hide signature help in function literals 2019-07-02 15:22:45 +00:00
snippets internal/lsp: don't qualify literal candidates in *ast.SelectorExpr 2019-10-16 23:29:27 +00:00
suggestedfix internal/lsp: enable suggested fixes by default 2019-09-09 19:40:07 +00:00
symbols internal/lsp: make interface methods children of the interface symbol 2019-04-24 02:46:01 +00:00
testy internal/lsp: move function signature into detail instead of label 2019-07-03 21:07:46 +00:00
typeassert internal/lsp: improve completion support for type assertions 2019-06-26 23:33:08 +00:00
types internal/lsp: add more testdata for completion and diagnostics 2018-11-20 06:06:34 +00:00
unimported internal/lsp: reorganize completion tests 2019-09-24 17:09:08 +00:00
unresolved internal/lsp: fix function value completions 2019-06-20 15:43:39 +00:00
unsafe internal/lsp: fix type checking for unsafe package 2019-06-11 19:41:53 +00:00
summary.txt.golden internal/lsp: fix bad *ast.ArrayTypes for completion 2019-10-17 20:53:01 +00:00