diff options
Diffstat (limited to 'gopls/doc/commands.md')
-rw-r--r-- | gopls/doc/commands.md | 110 |
1 files changed, 71 insertions, 39 deletions
diff --git a/gopls/doc/commands.md b/gopls/doc/commands.md index 65fa5c5ff..e7b6afb1d 100644 --- a/gopls/doc/commands.md +++ b/gopls/doc/commands.md @@ -100,6 +100,26 @@ Args: } ``` +### **Get known vulncheck result** +Identifier: `gopls.fetch_vulncheck_result` + +Fetch the result of latest vulnerability check (`govulncheck`). + +Args: + +``` +{ + // The file URI. + "URI": string, +} +``` + +Result: + +``` +map[golang.org/x/tools/gopls/internal/lsp/protocol.DocumentURI]*golang.org/x/tools/gopls/internal/govulncheck.Result +``` + ### **Toggle gc_details** Identifier: `gopls.gc_details` @@ -127,20 +147,6 @@ Args: } ``` -### **Generate gopls.mod** -Identifier: `gopls.generate_gopls_mod` - -(Re)generate the gopls.mod file for a workspace. - -Args: - -``` -{ - // The file URI. - "URI": string, -} -``` - ### **go get a package** Identifier: `gopls.go_get_package` @@ -216,6 +222,23 @@ Result: } ``` +### **fetch memory statistics** +Identifier: `gopls.mem_stats` + +Call runtime.GC multiple times and return memory statistics as reported by +runtime.MemStats. + +This command is used for benchmarking, and may change in the future. + +Result: + +``` +{ + "HeapAlloc": uint64, + "HeapInUse": uint64, +} +``` + ### **Regenerate cgo** Identifier: `gopls.regenerate_cgo` @@ -247,26 +270,26 @@ Args: } ``` -### **Run test(s)** -Identifier: `gopls.run_tests` +### **Reset go.mod diagnostics** +Identifier: `gopls.reset_go_mod_diagnostics` -Runs `go test` for a specific set of test or benchmark functions. +Reset diagnostics in the go.mod file of a module. Args: ``` { - // The test file containing the tests to run. - "URI": string, - // Specific test names to run, e.g. TestFoo. - "Tests": []string, - // Specific benchmarks to run, e.g. BenchmarkFoo. - "Benchmarks": []string, + "URIArg": { + "URI": string, + }, + // Optional: source of the diagnostics to reset. + // If not set, all resettable go.mod diagnostics will be cleared. + "DiagnosticSource": string, } ``` -### **Run vulncheck (experimental)** -Identifier: `gopls.run_vulncheck_exp` +### **Run govulncheck.** +Identifier: `gopls.run_govulncheck` Run vulnerability check (`govulncheck`). @@ -274,8 +297,8 @@ Args: ``` { - // Dir is the directory from which vulncheck will run from. - "Dir": string, + // Any document in the directory from which govulncheck will run. + "URI": string, // Package pattern. E.g. "", ".", "./...". "Pattern": string, } @@ -285,18 +308,27 @@ Result: ``` { - "Vuln": []{ - "ID": string, - "Details": string, - "Aliases": []string, - "Symbol": string, - "PkgPath": string, - "ModPath": string, - "URL": string, - "CurrentVersion": string, - "FixedVersion": string, - "CallStacks": [][]golang.org/x/tools/internal/lsp/command.StackEntry, - }, + // Token holds the progress token for LSP workDone reporting of the vulncheck + // invocation. + "Token": interface{}, +} +``` + +### **Run test(s)** +Identifier: `gopls.run_tests` + +Runs `go test` for a specific set of test or benchmark functions. + +Args: + +``` +{ + // The test file containing the tests to run. + "URI": string, + // Specific test names to run, e.g. TestFoo. + "Tests": []string, + // Specific benchmarks to run, e.g. BenchmarkFoo. + "Benchmarks": []string, } ``` |