Giant blob of minor changes
[dotfiles/.git] / .config / coc / extensions / coc-go-data / tools / pkg / mod / golang.org / x / tools / gopls@v0.5.2 / doc / commands.md
1 # Commands
2
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.
4
5 <!-- BEGIN Commands: DO NOT MANUALLY EDIT THIS SECTION -->
6 ### **Run go generate**
7 Identifier: `gopls.generate`
8
9 generate runs `go generate` for a given directory.
10
11
12 ### **Fill struct**
13 Identifier: `gopls.fill_struct`
14
15 fill_struct is a gopls command to fill a struct with default
16 values.
17
18
19 ### **Regenerate cgo**
20 Identifier: `gopls.regenerate_cgo`
21
22 regenerate_cgo regenerates cgo definitions.
23
24
25 ### **Run test(s)**
26 Identifier: `gopls.test`
27
28 test runs `go test` for a specific test function.
29
30
31 ### **Run go mod tidy**
32 Identifier: `gopls.tidy`
33
34 tidy runs `go mod tidy` for a module.
35
36
37 ### **Undeclared name**
38 Identifier: `gopls.undeclared_name`
39
40 undeclared_name adds a variable declaration for an undeclared
41 name.
42
43
44 ### **Upgrade dependency**
45 Identifier: `gopls.upgrade_dependency`
46
47 upgrade_dependency upgrades a dependency.
48
49
50 ### **Run go mod vendor**
51 Identifier: `gopls.vendor`
52
53 vendor runs `go mod vendor` for a module.
54
55
56 ### **Extract to variable**
57 Identifier: `gopls.extract_variable`
58
59 extract_variable extracts an expression to a variable.
60
61
62 ### **Extract to function**
63 Identifier: `gopls.extract_function`
64
65 extract_function extracts statements to a function.
66
67
68 ### **Toggle gc_details**
69 Identifier: `gopls.gc_details`
70
71 gc_details controls calculation of gc annotations.
72
73
74 ### **Generate gopls.mod**
75 Identifier: `gopls.generate_gopls_mod`
76
77 generate_gopls_mod (re)generates the gopls.mod file.
78
79
80 <!-- END Commands: DO NOT MANUALLY EDIT THIS SECTION -->