mirror of https://github.com/golang/go.git
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> |
||
|---|---|---|
| .. | ||
| analysisinternal | ||
| apidiff | ||
| event | ||
| fakenet | ||
| fastwalk | ||
| gocommand | ||
| gopathwalk | ||
| imports | ||
| jsonrpc2 | ||
| lsp | ||
| memoize | ||
| packagesinternal | ||
| proxydir | ||
| span | ||
| stack | ||
| testenv | ||
| tool | ||
| typesinternal | ||
| xcontext | ||