Skip to content

Commit 625a648

Browse files
committed
extension: add compiler optimization details command to setting
The "go.editorContextMenuCommands" setting controls which commands are available from the right-click context menu. This CL adds an additional field on that setting - "compilerDetails" - that when set to true will show the "Go: Toggle compiler optimization details" command in the context menu. Previously, this command could only be run via the command palette. Fixes #3899 Change-Id: I9e3347e9c3dd648772eb37403acd0d1219fbef48 Reviewed-on: https://go-review.googlesource.com/c/vscode-go/+/712381 LUCI-TryBot-Result: Go LUCI <[email protected]> Reviewed-by: Hongxiang Jiang <[email protected]>
1 parent d431b5e commit 625a648

File tree

3 files changed

+18
-1
lines changed

3 files changed

+18
-1
lines changed

CHANGELOG.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,10 @@ The format is based on [Keep a Changelog](http://keepachangelog.com/).
55

66
## Unreleased
77

8+
### Changes
9+
10+
* Added a new field, 'compilerDetails', on the 'go.editorContextMenuCommands' setting that when set to true will show the "Go: Toggle compiler optimization details" command in the context menu.
11+
812
### Important
913

1014
* To ensure the extension remains fully compatible and stable, the required

docs/settings.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -172,6 +172,7 @@ Experimental Feature: Enable/Disable entries from the context menu in the editor
172172
| `addImport` | If true, adds command to import a package to the editor context menu <br/> Default: `true` |
173173
| `addTags` | If true, adds command to add configured tags from struct fields to the editor context menu <br/> Default: `true` |
174174
| `benchmarkAtCursor` | If true, adds command to benchmark the test under the cursor to the editor context menu <br/> Default: `false` |
175+
| `compilerDetails` | If true, adds command to show compiler optimization details under the cursor to the editor context menu <br/> Default: `false` |
175176
| `debugTestAtCursor` | If true, adds command to debug the test under the cursor to the editor context menu <br/> Default: `false` |
176177
| `fillStruct` | If true, adds command to fill struct literal with default values to the editor context menu <br/> Default: `true` |
177178
| `generateTestForFile` | If true, adds command to generate unit tests for current file to the editor context menu <br/> Default: `true` |
@@ -191,6 +192,7 @@ Default:
191192
"addImport" : true,
192193
"addTags" : true,
193194
"benchmarkAtCursor" : false,
195+
"compilerDetails" : false,
194196
"debugTestAtCursor" : true,
195197
"fillStruct" : false,
196198
"generateTestForFile" : false,

extension/package.json

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1780,6 +1780,11 @@
17801780
"type": "boolean",
17811781
"default": false,
17821782
"description": "If true, adds command to benchmark the test under the cursor to the editor context menu"
1783+
},
1784+
"compilerDetails": {
1785+
"type": "boolean",
1786+
"default": false,
1787+
"description": "If true, adds command to show compiler optimization details under the cursor to the editor context menu"
17831788
}
17841789
},
17851790
"additionalProperties": false,
@@ -1798,7 +1803,8 @@
17981803
"testCoverage": true,
17991804
"playground": true,
18001805
"debugTestAtCursor": true,
1801-
"benchmarkAtCursor": false
1806+
"benchmarkAtCursor": false,
1807+
"compilerDetails": false
18021808
},
18031809
"description": "Experimental Feature: Enable/Disable entries from the context menu in the editor.",
18041810
"scope": "resource"
@@ -3577,6 +3583,11 @@
35773583
"command": "go.playground",
35783584
"group": "Go group 1"
35793585
},
3586+
{
3587+
"when": "editorTextFocus && config.go.editorContextMenuCommands.compilerDetails && resourceLangId == go",
3588+
"command": "go.toggle.gc_details",
3589+
"group": "Go group 1"
3590+
},
35803591
{
35813592
"when": "editorTextFocus && resourceLangId == go",
35823593
"command": "go.show.commands",

0 commit comments

Comments
 (0)