internal/lsp/command: stub out the ListKnownPackages and AddImport commands
Add the ListKnownPackages and AddImport methods to command.Interface and
regenerate bindings. Add empty implementations to lsp.commandHandler.
These are our first commands returning results. I'll update our docgen
to support result in a subsequent CL.
Change-Id: Ic3b7c0d9383ac8f3e1cb546a71e9c496a92a7840
Reviewed-on: https://go-review.googlesource.com/c/tools/+/291129
Reviewed-by: Rebecca Stambler <rstambler@golang.org>
gopls-CI: kokoro <noreply+kokoro@google.com>
TryBot-Result: Go Bot <gobot@golang.org>
Trust: Robert Findley <rfindley@google.com>
Run-TryBot: Robert Findley <rfindley@google.com>
diff --git a/internal/lsp/source/api_json.go b/internal/lsp/source/api_json.go
index 83b3b34..7352130 100755
--- a/internal/lsp/source/api_json.go
+++ b/internal/lsp/source/api_json.go
@@ -679,6 +679,12 @@
ArgDoc: "{\n\t// The go.mod file URI.\n\t\"URI\": string,\n\t// Additional args to pass to the go command.\n\t\"GoCmdArgs\": []string,\n\t// Whether to add a require directive.\n\t\"AddRequire\": bool,\n}",
},
{
+ Command: "gopls.add_import",
+ Title: "",
+ Doc: "",
+ ArgDoc: "{\n\t\"ImportPath\": string,\n\t\"URI\": string,\n}",
+ },
+ {
Command: "gopls.apply_fix",
Title: "Apply a fix",
Doc: "Applies a fix to a region of source code.",
@@ -715,6 +721,12 @@
ArgDoc: "{\n\t// Any document URI within the relevant module.\n\t\"URI\": string,\n\t// The package to go get.\n\t\"Pkg\": string,\n\t\"AddRequire\": bool,\n}",
},
{
+ Command: "gopls.list_known_packages",
+ Title: "",
+ Doc: "",
+ ArgDoc: "{\n\t// The file URI.\n\t\"URI\": string,\n}",
+ },
+ {
Command: "gopls.regenerate_cgo",
Title: "Regenerate cgo",
Doc: "Regenerates cgo definitions.",