3 This document describes the LSP-level commands supported by `gopls`. They cannot be invoked directly by users, and all the details are subject to change, so nobody should rely on this information.
5 <!-- BEGIN Commands: DO NOT MANUALLY EDIT THIS SECTION -->
6 ### **Run go generate**
7 Identifier: `gopls.generate`
9 generate runs `go generate` for a given directory.
13 Identifier: `gopls.fill_struct`
15 fill_struct is a gopls command to fill a struct with default
19 ### **Regenerate cgo**
20 Identifier: `gopls.regenerate_cgo`
22 regenerate_cgo regenerates cgo definitions.
26 Identifier: `gopls.test`
28 test runs `go test` for a specific test function.
31 ### **Run go mod tidy**
32 Identifier: `gopls.tidy`
34 tidy runs `go mod tidy` for a module.
37 ### **Undeclared name**
38 Identifier: `gopls.undeclared_name`
40 undeclared_name adds a variable declaration for an undeclared
44 ### **Upgrade dependency**
45 Identifier: `gopls.upgrade_dependency`
47 upgrade_dependency upgrades a dependency.
50 ### **Run go mod vendor**
51 Identifier: `gopls.vendor`
53 vendor runs `go mod vendor` for a module.
56 ### **Extract to variable**
57 Identifier: `gopls.extract_variable`
59 extract_variable extracts an expression to a variable.
62 ### **Extract to function**
63 Identifier: `gopls.extract_function`
65 extract_function extracts statements to a function.
68 ### **Toggle gc_details**
69 Identifier: `gopls.gc_details`
71 gc_details controls calculation of gc annotations.
74 ### **Generate gopls.mod**
75 Identifier: `gopls.generate_gopls_mod`
77 generate_gopls_mod (re)generates the gopls.mod file.
80 <!-- END Commands: DO NOT MANUALLY EDIT THIS SECTION -->