You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: docs/commands.md
+81-92Lines changed: 81 additions & 92 deletions
Original file line number
Diff line number
Diff line change
@@ -21,175 +21,164 @@ Finally, you can also see a full list by using a meta command: `Go: Show All Com
21
21
22
22
## Detailed list
23
23
24
-
<!--TODO(rstambler): Automatically generate this list using the package.json.-->
24
+
<!-- Everything below this line is generated. DO NOT EDIT. -->
25
25
26
-
Below is a detailed list of commands. They are categorized into [code editing and generation](#code-editing-and-generation), [testing and benchmarking](#testing-and-benchmarking), [build, lint, and vet](#build-lint-and-vet), [miscellaneous](#miscellaneous), and [troubleshooting](#troubleshooting). You will find the [troubleshooting](#troubleshooting) commands helpful when diagnosing an issue with the extension (learn more in the [Troubleshooting documentation](troubleshooting.md)).
26
+
### `Go: Current GOPATH`
27
27
28
-
### Code editing and generation
28
+
See the currently set GOPATH.
29
29
30
-
<!--Note: Try to keep this list in roughly alphabetical/logical order.-->
30
+
### `Go: Locate Configured Go Tools`
31
31
32
-
#### [`Go: Add Import`](features.md#add-import)
32
+
List all the Go tools being used by this extension along with their locations.
33
33
34
-
<!--TODO(rstambler): Confirm exactly how this works.-->
35
-
Manually add an import to your file. See [Add import](features.md#add-import).
34
+
### `Go: Test Function At Cursor`
36
35
37
-
#### [`Go: Add Package to Workspace`]
36
+
Runs a unit test at the cursor.
38
37
39
-
Add a package to the current workspace.
38
+
### `Go: Subtest At Cursor`
40
39
41
-
<!--TODO(rstambler): Figure out how this command works, its use cases, and how it fits into modules.-->
40
+
Runs a sub test at the cursor.
42
41
43
-
#### [`Go: Add Tags to Struct Fields`](features.md#add-struct-tags)
42
+
###`Go: Benchmark Function At Cursor`
44
43
45
-
Automatically generate [tags](https://pkg.go.dev/reflect?tab=doc#StructTag) for your struct. See [Add or remove struct tags](features.md#add-or-remove-struct-tags).
44
+
Runs a benchmark at the cursor.
46
45
47
-
#### [`Go: Remove Tags From Struct Fields`](features.md#add-struct-tags)
46
+
###`Go: Debug Test At Cursor`
48
47
49
-
Removes [tags](https://pkg.go.dev/reflect?tab=doc#StructTag) from the selected struct fields. See [Add or remove struct tags](features.md#add-or-remove-struct-tags).
48
+
Debug test at the cursor.
50
49
51
-
#### [`Go: Fill struct`](features.md#fill-struct-literals)
50
+
###`Go: Test File`
52
51
53
-
Fill a struct literal with default values. See [Fill struct](features.md#fill-struct-literals).
Generate method stubs for given interface. See [Generate interface implementation](features.md#generate-interface-implementation).
56
+
Runs all unit tests in the package of the current file.
58
57
59
-
#### [`Go: Generate Unit Tests For Function`](features.md#generate-unit-tests)
58
+
###`Go: Benchmark Package`
60
59
61
-
Generate unit tests for the selected function in the current file. See [Generate unit tests](features.md#generate-unit-tests).
60
+
Runs all benchmarks in the package of the current file.
62
61
63
-
#### [`Go: Generate Unit Tests For File`](features.md#generate-unit-tests)
62
+
###`Go: Benchmark File`
64
63
65
-
Generate unit tests for the current file. See [Generate unit tests](features.md#generate-unit-tests).
64
+
Runs all benchmarks in the current file.
66
65
67
-
#### [`Go: Generate Unit Tests For Package`](features.md#generate-unit-tests)
66
+
###`Go: Test All Packages In Workspace`
68
67
69
-
Generate unit tests for the current package. See [Generate unit tests](features.md#generate-unit-tests).
68
+
Runs all unit tests from all packages in the current workspace.
70
69
71
-
#### [`Go: Extract to function`](features.md#refactor)
70
+
###`Go: Test Previous`
72
71
73
-
Extract the highlighted code to a function. Provided by the [`godoctor`](tools.md#godoctor) tool. Learn more about [refactoring](features.md#refactoring).
72
+
Re-runs the last executed test.
74
73
75
-
#### [`Go: Extract to variable`](features.md#refactor)
74
+
###`Go: Toggle Test Coverage In Current Package`
76
75
77
-
Extract the highlighted code to a local variable. Provided by the [`godoctor`](tools.md#godoctor) tool. Learn more about [refactoring](features.md#refactoring).
76
+
Displays test coverage in the current package.
78
77
79
-
### Testing and benchmarking
78
+
### `Go: Generate Unit Tests For Package`
80
79
81
-
#### [`Go: Test Function at Cursor`](features.md#test-and-benchmark-in-the-editor)
80
+
Generates unit tests for the current package
82
81
83
-
Run the test function at the current cursor position in the file.
82
+
### `Go: Generate Unit Tests For File`
84
83
85
-
#### [`Go: Subtest at Cursor`](features.md#test-and-benchmark-in-the-editor)
84
+
Generates unit tests for the current file
86
85
87
-
Run the subtest (`t.Run`) at the current cursor position in the file.
86
+
### `Go: Generate Unit Tests For Function`
88
87
89
-
#### [`Go: Benchmark Function At Cursor`](features.md#test-and-benchmark-in-the-editor)
88
+
Generates unit tests for the selected function in the current file
90
89
91
-
Run the benchmark at the current cursor position in the file.
90
+
### `Go: Generate Interface Stubs`
92
91
93
-
#### [`Go: Debug Test At Cursor`](features.md#debugging)
92
+
Generates method stub for implementing the provided interface and inserts at the cursor.
94
93
95
-
Debug the test at the current cursor position.
94
+
### `Go: Add Import`
96
95
97
-
#### [`Go: Test File`](features.md#test-and-benchmark-in-the-editor)
Show lint errors for all of the packages in the current workspace.
160
+
Build the current workspace.
162
161
163
-
####`Go: Install Current Package`
162
+
### `Go: Install Current Package`
164
163
165
-
Install the current package and its dependencies.
164
+
Install the current package.
166
165
167
-
### Miscellaneous
166
+
### `Go: Cancel Running Tests`
168
167
169
-
#### [`Go: Restart Language Server`](gopls.md)
168
+
Cancels running tests.
170
169
171
-
Use this command to restart the [language server](gopls.md) without reloading the VS Code window. This can be helpful if something seems goes wrong with the language server (for example, if you see incorrect error messages).
170
+
### `Go: Apply Cover Profile`
172
171
173
-
#### [`Go: Run on Go Playground`](features.md#go-playground)
172
+
Applies existing cover profile.
174
173
175
-
Upload the current selection or file to the Go Playground ([play.golang.org](https://play.golang.org)). See [Go Playground](features.md#go-playground).
174
+
### `Go: Extract to function`
176
175
177
-
### Troubleshooting
176
+
Extract to function using godoctor.
178
177
179
-
####`Go: Current GOPATH`
178
+
### `Go: Extract to variable`
180
179
181
-
See the current value of GOPATH. This is not equivalent to `go env GOPATH`, as your VS Code settings may have altered the value of `GOPATH` used by the extension. This command is helpful when [troubleshooting](troubleshooting.md) the extension.
180
+
Extract to variable using godoctor.
182
181
183
-
#### [`Go: Install/Update Tools`](tools.md)
182
+
###`Go: Restart Language Server`
184
183
185
-
Install or update the Go tools on which the extension depends. Tools can be installed or updated all at once, or individual tools can be selected.
186
-
187
-
#### [`Go: Locate Configured Go Tools`](troubleshooting.md#check-your-set-up)
188
-
189
-
This command is helpful when [troubleshooting](troubleshooting.md) the extension. It prints out the environment variables and paths to the tools used by the extension. See an example of the command's output in the [troubleshooting documentation](troubleshooting.md#check-your-set-up).
0 commit comments