go/internal
Rob Findley a30116df7a internal/lsp: eliminate funcs from commands, and refactor
appliesFn and suggestedFixFn were blocking eliminating the
source.Command dynamic configuration. Remove them, and along the way
refactor command dispatch to align better with the new
internal/lsp/command package.

This involved refactoring the internal/lsp/command.go as follows:
 - create a new commandHandler type, which will eventually implement
   command.Interface.
 - create a commandDeps struct to hold command dependencies.
 - move command functionality into methods on commandHandler.

Of these, there are likely to be at least a couple points of controvery:

I decided to store the ctx on the commandHandler, because I preferred it
to threading a context through command.Interface when it isn't needed.
We should revisit this in a later CL.

I opted for a sparse commandDeps struct, rather than either explicit
resolution of dependencies where necessary, or something more abstract
like a proper dependency resolution pattern. It saved enough boilerplate
that I deemed it worthwhile, but didn't want to commit to something more
sophisticated.

Actually switching to the internal/lsp/command package will happen in a
later CL.

Change-Id: I71502fc68f51f1b296bc529ee2885f7547145e92
Reviewed-on: https://go-review.googlesource.com/c/tools/+/289970
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:07:08 +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 internal/fakenet: add a fake network connection 2020-05-27 14:27:59 +00:00
fastwalk internal/fastwalk: attempt Symlink tests on Windows 2020-05-21 21:19:27 +00:00
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: eliminate funcs from commands, and refactor 2021-02-09 22:07:08 +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 all: remove version-specific test files 2020-05-28 17:13:50 +00:00
span internal/typesinternal: use Go 1.16 metadata for go/types errors 2020-12-07 17:42:14 +00:00
stack internal/stack: add the leak test 2020-05-27 14:25:42 +00:00
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