Skip to content

Commit

Permalink
package.json: support testAtCursor (and co.) despite codelenses
Browse files Browse the repository at this point in the history
We've decided to disable these by default, but support them even if you
have the `run test` codelenses.

Fixes golang#1768

Change-Id: Ia873f63fa89a90f73d90124ef58b2aad517410e7
Reviewed-on: https://go-review.googlesource.com/c/vscode-go/+/350769
Trust: Rebecca Stambler <[email protected]>
Run-TryBot: Rebecca Stambler <[email protected]>
TryBot-Result: kokoro <[email protected]>
Reviewed-by: Suzy Mueller <[email protected]>
  • Loading branch information
stamblerre committed Sep 20, 2021
1 parent 171cc61 commit 0f196ff
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 9 deletions.
6 changes: 3 additions & 3 deletions docs/settings.md
Original file line number Diff line number Diff line change
Expand Up @@ -182,15 +182,15 @@ Experimental Feature: Enable/Disable entries from the context menu in the editor
| --- | --- |
| `addImport` | If true, adds command to import a package to the editor context menu <br/> Default: `true` |
| `addTags` | If true, adds command to add configured tags from struct fields to the editor context menu <br/> Default: `true` |
| `benchmarkAtCursor` | If true, adds command to benchmark the test under the cursor to the editor context menu <br/> Default: `true` |
| `debugTestAtCursor` | If true, adds command to debug the test under the cursor to the editor context menu <br/> Default: `true` |
| `benchmarkAtCursor` | If true, adds command to benchmark the test under the cursor to the editor context menu <br/> Default: `false` |
| `debugTestAtCursor` | If true, adds command to debug the test under the cursor to the editor context menu <br/> Default: `false` |
| `fillStruct` | If true, adds command to fill struct literal with default values to the editor context menu <br/> Default: `true` |
| `generateTestForFile` | If true, adds command to generate unit tests for current file to the editor context menu <br/> Default: `true` |
| `generateTestForFunction` | If true, adds command to generate unit tests for function under the cursor to the editor context menu <br/> Default: `true` |
| `generateTestForPackage` | If true, adds command to generate unit tests for currnt package to the editor context menu <br/> Default: `true` |
| `playground` | If true, adds command to upload the current file or selection to the Go Playground <br/> Default: `true` |
| `removeTags` | If true, adds command to remove configured tags from struct fields to the editor context menu <br/> Default: `true` |
| `testAtCursor` | If true, adds command to run the test under the cursor to the editor context menu <br/> Default: `true` |
| `testAtCursor` | If true, adds command to run the test under the cursor to the editor context menu <br/> Default: `false` |
| `testCoverage` | If true, adds command to run test coverage to the editor context menu <br/> Default: `true` |
| `testFile` | If true, adds command to run all tests in the current file to the editor context menu <br/> Default: `true` |
| `testPackage` | If true, adds command to run all tests in the current package to the editor context menu <br/> Default: `true` |
Expand Down
12 changes: 6 additions & 6 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -1662,7 +1662,7 @@
},
"testAtCursor": {
"type": "boolean",
"default": true,
"default": false,
"description": "If true, adds command to run the test under the cursor to the editor context menu"
},
"testFile": {
Expand Down Expand Up @@ -1707,12 +1707,12 @@
},
"debugTestAtCursor": {
"type": "boolean",
"default": true,
"default": false,
"description": "If true, adds command to debug the test under the cursor to the editor context menu"
},
"benchmarkAtCursor": {
"type": "boolean",
"default": true,
"default": false,
"description": "If true, adds command to benchmark the test under the cursor to the editor context menu"
}
},
Expand Down Expand Up @@ -2443,17 +2443,17 @@
"group": "Go group 1"
},
{
"when": "editorTextFocus && config.go.editorContextMenuCommands.testAtCursor && resourceLangId == go && !config.editor.codeLens",
"when": "editorTextFocus && config.go.editorContextMenuCommands.testAtCursor && resourceLangId == go",
"command": "go.test.cursor",
"group": "Go group 1"
},
{
"when": "editorTextFocus && config.go.editorContextMenuCommands.benchmarkAtCursor && resourceLangId == go && !config.editor.codeLens",
"when": "editorTextFocus && config.go.editorContextMenuCommands.benchmarkAtCursor && resourceLangId == go",
"command": "go.benchmark.cursor",
"group": "Go group 1"
},
{
"when": "editorTextFocus && config.go.editorContextMenuCommands.debugTestAtCursor && resourceLangId == go && !config.editor.codeLens",
"when": "editorTextFocus && config.go.editorContextMenuCommands.debugTestAtCursor && resourceLangId == go",
"command": "go.debug.cursor",
"group": "Go group 1"
},
Expand Down

0 comments on commit 0f196ff

Please sign in to comment.