Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
internal/lsp/command: add an interface for workspace/executeCommand
This CL lays the groundwork for future refactoring, by defining a formal (Go) interface for the set of commands provided by gopls in the workspace/executeCommand RPC. It then creates some boilerplate bindings via code generation. The intent is to, first of all, clean up our current usage of commands. Currently the 'specification' of a command is really split across internal/lsp/command.go, internal/lsp/source/command.go, and internal/lsp/source/code_lens.go. Changing a command signature might require altering all three of those files, and it's easy to get wrong. But also, we'd like to eventually be able to tell plugin authors that they can call our commands in an ad-hoc manner (meaning with arguments that they assign, rather than extract from a code lens). In order to do that, we need to be able to generate documentation for the command signature, and should also stop using positional arguments. This CL aims to solve that as well, by providing a commandmeta package that can be used for document generation. For golang/go#40438 Change-Id: I0d29de044e107d6e7b267f340879a5282f0b4944 Reviewed-on: https://go-review.googlesource.com/c/tools/+/289489 Trust: Robert Findley <[email protected]> Run-TryBot: Robert Findley <[email protected]> gopls-CI: kokoro <[email protected]> TryBot-Result: Go Bot <[email protected]> Reviewed-by: Rebecca Stambler <[email protected]> Reviewed-by: Heschi Kreinick <[email protected]>
- Loading branch information