1
0
mirror of https://github.com/golang/go synced 2024-10-01 09:38:36 -06:00
go/internal/lsp/testdata
Muir Manders f66ef90017 internal/lsp/source: improve completion after accidental keywords
Completion often fails when the completion prefix happens to be a
keyword. We previously tried to fix this with AST surgery, but
often the accidental keyword is not apparent looking at the AST.
For example:

    chan<>
    foo()

parses as CallExpr{Fun: ChanType{Value: Ident{"foo"}}} with very few
hints that something is wrong, and:

    default
    foo()

is completely omitted from the AST.

Rather than look in the AST, we now instead manually look for a
keyword token that contains the completion position. If we find one,
we treat that as our surrounding identifier.

Updates golang/go#34332.

Change-Id: I68ed0dd905848c0eae61f39ecb8b73adb1e72746
Reviewed-on: https://go-review.googlesource.com/c/tools/+/216961
Run-TryBot: Muir Manders <muir@mnd.rs>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Rebecca Stambler <rstambler@golang.org>
2020-02-06 05:08:22 +00:00
..
%percent internal/lsp/tests: add severity parameter to @diag markers 2020-02-04 19:24:00 +00:00
address internal/lsp/source: support dereferencing for completion 2020-01-22 21:43:17 +00:00
analyzer internal/lsp/tests: add severity parameter to @diag markers 2020-02-04 19:24:00 +00:00
anon internal/lsp: add additional tests for completion 2018-12-19 22:27:14 +00:00
append internal/lsp: improve completion in append() calls 2019-11-09 21:27:01 +00:00
arraytype internal/lsp: improve completion for *ast.ArrayTypes 2019-10-23 16:34:50 +00:00
assign internal/lsp/source: improve completion in value spec 2019-12-23 21:16:02 +00:00
bad internal/lsp/tests: add severity parameter to @diag markers 2020-02-04 19:24:00 +00:00
badstmt internal/lsp/tests: add severity parameter to @diag markers 2020-02-04 19:24:00 +00:00
bar internal/lsp: improve completion for *ast.ArrayTypes 2019-10-23 16:34:50 +00:00
basiclit internal/lsp: suppress more completions in comments and literals 2019-04-24 20:52:08 +00:00
baz internal/lsp: search candidate type's package for completions 2019-10-30 06:26:58 +00:00
builtins internal/lsp/source: improve completion for "make()" args 2020-02-02 23:20:50 +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
cgo internal/lsp/tests: skip cgo tests when not supported 2019-11-25 21:54:41 +00:00
cgoimport internal/lsp: improve link in documentation on hover 2019-12-12 22:39:21 +00:00
channel internal/lsp: support taking address for completion candidates 2019-12-23 23:54:10 +00:00
circular internal/lsp/tests: add severity parameter to @diag markers 2020-02-04 19:24:00 +00:00
comments internal/lsp: suppress more completions in comments and literals 2019-04-24 20:52:08 +00:00
complit internal/lsp: add comment completions for exported vars 2019-12-10 22:11:41 +00:00
constant internal/lsp: remove constant value from label and add tests 2019-05-15 19:19:14 +00:00
deep internal/lsp/source: support dereferencing for completion 2020-01-22 21:43:17 +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 tools/gopls: add cmd support for folding_ranges 2019-11-12 00:55:09 +00:00
foo internal/lsp: fix bad *ast.ArrayTypes for completion 2019-10-17 20:53:01 +00:00
format internal/lsp/tests: add severity parameter to @diag markers 2020-02-04 19:24:00 +00:00
func_rank internal/lsp/source: improve completion in type assertions 2020-01-16 01:06:23 +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
fuzzymatch internal/lsp: reorganize and refactor code 2019-11-21 02:33:28 +00:00
generated internal/lsp/tests: add severity parameter to @diag markers 2020-02-04 19:24:00 +00:00
godef internal/lsp: add support for workspace symbol 2020-02-05 19:03:17 +00:00
good internal/lsp/tests: add severity parameter to @diag markers 2020-02-04 19:24:00 +00:00
highlights internal/lsp: add highlighting for import statement 2020-01-17 17:07:20 +00:00
implementation internal/lsp: refactor find-implementation handling 2019-12-23 22:59:19 +00:00
importedcomplit internal/lsp: fix composite literal completion 2019-05-13 22:24:33 +00:00
imports internal/lsp/source: start import diffs at byte 0 2019-11-08 19:30:12 +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
keywords internal/lsp/source: improve completion after accidental keywords 2020-02-06 05:08:22 +00:00
labels internal/lsp: fix label completion in range and type switch stmts 2019-10-22 21:33:09 +00:00
links internal/lsp: create links for golang/go#1234-style strings 2019-12-27 05:39:25 +00:00
maps internal/lsp/source: improve completion in type assertions 2020-01-16 01:06:23 +00:00
multireturn internal/lsp/source: improve completion involving multiple return values 2020-02-06 05:07:08 +00:00
nested_complit internal/lsp: improve completion for *ast.ArrayTypes 2019-10-23 16:34:50 +00:00
nodisk internal/lsp: fix race condition in metadata handling 2019-11-04 20:35:57 +00:00
noparse internal/lsp/tests: add severity parameter to @diag markers 2020-02-04 19:24:00 +00:00
noparse_format internal/lsp/tests: add severity parameter to @diag markers 2020-02-04 19:24:00 +00:00
rank internal/lsp: fix variadic interface completion ranking 2019-11-18 05:14:29 +00:00
references internal/lsp: refactor find-references and rename 2020-01-16 06:24:15 +00:00
rename internal/lsp: permit renaming symbols declared in other packages 2020-01-27 18:56:10 +00:00
selector internal/lsp: sort by label after score 2019-12-30 21:11:21 +00:00
signature internal/lsp: fix active parameter for incomplete parentheses 2020-01-27 19:24:44 +00:00
snippets internal/lsp/source: fix some invalid literal candidates 2020-01-08 20:36:44 +00:00
suggestedfix internal/lsp: enable suggested fixes by default 2019-09-09 19:40:07 +00:00
symbols internal/lsp: add support for workspace symbol 2020-02-05 19:03:17 +00:00
testy internal/lsp/tests: add severity parameter to @diag markers 2020-02-04 19:24:00 +00:00
typeassert internal/lsp/source: improve completion in type assertions 2020-01-16 01:06:23 +00:00
types internal/lsp: add more testdata for completion and diagnostics 2018-11-20 06:06:34 +00:00
unimported internal/imports: load test exports of package under test 2020-01-14 23:54:10 +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
variadic internal/lsp: fix variadic interface completion ranking 2019-11-18 05:14:29 +00:00
workspacesymbol internal/lsp: add support for workspace symbol 2020-02-05 19:03:17 +00:00
summary.txt.golden internal/lsp/source: improve completion after accidental keywords 2020-02-06 05:08:22 +00:00