go/internal
Rob Findley 8aef11fa67 internal/lsp: switch to the new command API
Fully switch to the new generated command API, and remove the old
dynamic command configuration.

This involved several steps:
 + Switch the command dispatch in internal/lsp/command.go to go through
   the command package. This means that all commands must now use the new
   signature.
 + Update commandHandler to use the new command signatures.
 + Fix some errors discovered in the command interface now that we're
   actually using it.
 + Regenerate bindings.
 + Update all code lens and suggested fixes to new the new command
   constructors.
 + Generate values in the command package to hold command names and the
   full set of commands, so that they may be referenced by name.
 + Update any references to command names to use the command package.
 + Delete command metadata from the source package. Rename command.go to
   fix.go.
 + Update lsp tests to execute commands directly rather than use an
   internal API. This involved a bit of hackery to collect the edits.
 + Update document generation to use command metadata. Documenting the
   arguments is left to a later CL.
 + Various small fixes related to the above.

This change is intended to be invisible to users. We have changed the
command signatures, but have not (previously) committed to backwards
compatibility for commands. Notably, the gopls.test and gopls.gc_details
signatures are preserved, as these are the two cases where we are aware
of LSP clients calling them directly, not from a code lens or
diagnostic.

For golang/go#40438

Change-Id: Ie1b92c95d6ce7e2fc25fc029d1f85b942f40e851
Reviewed-on: https://go-review.googlesource.com/c/tools/+/290111
Trust: Robert Findley <rfindley@google.com>
Run-TryBot: Robert Findley <rfindley@google.com>
gopls-CI: kokoro <noreply+kokoro@google.com>
TryBot-Result: Go Bot <gobot@golang.org>
Reviewed-by: Heschi Kreinick <heschi@google.com>
2021-02-09 22:09:28 +00:00
..
analysisinternal internal/lsp/fuzzy: fix return value on no match 2020-08-28 15:37:48 +00:00
apidiff all: add copyright notices to files that are missing them 2021-01-06 17:23:47 +00:00
event all: add copyright notices to files that are missing them 2021-01-06 17:23:47 +00:00
fakenet
fastwalk
gocommand internal/lsp: re-enable upgrades for individual dependencies 2021-02-01 17:10:16 +00:00
gopathwalk internal/imports: fix crash when adding stdlib imports 2020-08-13 17:47:04 +00:00
imports all: replace all usages of os/exec with golang.org/x/sys/execabs 2021-01-19 22:25:03 +00:00
jsonrpc2 internal/jsonrpc2: remove unused invalidID constant 2021-02-04 15:49:51 +00:00
lsp internal/lsp: switch to the new command API 2021-02-09 22:09:28 +00:00
memoize internal/memoize: add a final argument to Bind for cleaning up 2020-10-30 19:59:21 +00:00
packagesinternal internal/lsp/cache: disable network for mod tidy diagnostics 2021-02-05 19:41:14 +00:00
proxydir
span internal/typesinternal: use Go 1.16 metadata for go/types errors 2020-12-07 17:42:14 +00:00
stack
testenv all: replace all usages of os/exec with golang.org/x/sys/execabs 2021-01-19 22:25:03 +00:00
tool
typesinternal internal/typesinternal: use Go 1.16 metadata for go/types errors 2020-12-07 17:42:14 +00:00
xcontext