go/internal/lsp/source/completion
pjw 9ffa3ad372 internal/lsp: Provide completions for test function definitions
In test files, function definitions starting with
Test, Bench, or Fuzz can be completed almost automatically.

For the snippets the user hits tab, completes the name, hits
tab again, and the function is defined, except (of course) for its
body.

Otherwise a completion that fills in the signature is proposed.

Where appropriate, 'TestMain(m *testing.M)' is also offered as
a completion.

Fixes golang/go#46896 and golang/go#51089

Change-Id: I46c05af0ead79c1d82ca40b2c605045e06e1a35d
Reviewed-on: https://go-review.googlesource.com/c/tools/+/385974
Run-TryBot: Peter Weinberger <pjw@google.com>
Trust: Peter Weinberger <pjw@google.com>
TryBot-Result: Gopher Robot <gobot@golang.org>
gopls-CI: kokoro <noreply+kokoro@google.com>
Reviewed-by: Hyang-Ah Hana Kim <hyangah@gmail.com>
2022-02-25 19:27:31 +00:00
..
builtin.go lsp/completion: support completing to Elem() types 2021-06-09 15:58:30 +00:00
completion.go internal/lsp: Provide completions for test function definitions 2022-02-25 19:27:31 +00:00
deep_completion.go lsp/completion: reduce garbage searching for candidates 2021-08-12 17:14:32 +00:00
deep_completion_test.go
definition.go internal/lsp: Provide completions for test function definitions 2022-02-25 19:27:31 +00:00
format.go internal/lsp/source: clean up the interface to hover information 2022-02-17 17:38:22 +00:00
keywords.go internal/lsp/source/completion: remove "completion_" prefix from files 2020-10-30 17:45:15 +00:00
labels.go internal/lsp/source/completion: remove "completion_" prefix from files 2020-10-30 17:45:15 +00:00
literal.go internal/lsp/source/completion: add conventional acronyms for type names 2022-02-03 15:53:42 +00:00
package.go internal/lsp: use source.Offset instead of tok.Offset 2021-10-12 22:12:04 +00:00
package_test.go internal/lsp/source/completion: suggest only valid package names 2021-04-27 19:53:45 +00:00
postfix_snippets.go gopls: add string join/split postfix completions 2022-01-11 13:55:59 +00:00
printf.go internal/lsp: fix some incorrect spelling 2020-11-24 11:59:21 +00:00
printf_test.go internal/lsp/source/completion: remove "completion_" prefix from files 2020-10-30 17:45:15 +00:00
snippet.go lsp/completion: reorganize how we track candidate type mods 2021-06-09 15:58:13 +00:00
statements.go internal/lsp: add snippet completion for t.Fatal errs 2021-03-15 21:39:02 +00:00
util.go internal/lsp/source/completion: add postfix snippet completions 2021-03-29 17:27:46 +00:00
util_test.go