diff --git a/docs/commands.md b/docs/commands.md index 37da3ae718..cd61af788b 100644 --- a/docs/commands.md +++ b/docs/commands.md @@ -139,9 +139,9 @@ Extract logs in the `gopls (server)` output channel to the editor. Open the welcome page for the Go extension. -### `Go: Toggle gc details` +### `Go: Toggle compiler optimization details` -Toggle the display of compiler optimization choices +Toggle the per-package flag that causes compiler optimization details to be reported as diagnostics ### `Go: Add Import` diff --git a/extension/package.json b/extension/package.json index f9e0e92870..7ce4b2f122 100644 --- a/extension/package.json +++ b/extension/package.json @@ -355,8 +355,8 @@ }, { "command": "go.toggle.gc_details", - "title": "Go: Toggle gc details", - "description": "Toggle the display of compiler optimization choices" + "title": "Go: Toggle compiler optimization details", + "description": "Toggle the per-package flag that causes compiler optimization details to be reported as diagnostics" }, { "command": "go.import.add", diff --git a/extension/src/commands/toggleGCDetails.ts b/extension/src/commands/toggleGCDetails.ts index 20dfaec67f..fd7d94722b 100644 --- a/extension/src/commands/toggleGCDetails.ts +++ b/extension/src/commands/toggleGCDetails.ts @@ -11,19 +11,21 @@ export const toggleGCDetails: CommandFactory = (ctx, goCtx) => { return async () => { if (!goCtx.languageServerIsRunning) { vscode.window.showErrorMessage( - '"Go: Toggle gc details" command is available only when the language server is running' + '"Go: Toggle compiler optimization details" command is available only when the language server is running' ); return; } const doc = vscode.window.activeTextEditor?.document.uri.toString(); if (!doc || !doc.endsWith('.go')) { - vscode.window.showErrorMessage('"Go: Toggle gc details" command cannot run when no Go file is open.'); + vscode.window.showErrorMessage( + '"Go: Toggle compiler optimization details" command cannot run when no Go file is open.' + ); return; } try { await vscode.commands.executeCommand('gopls.gc_details', doc); } catch (e) { - vscode.window.showErrorMessage(`"Go: Toggle gc details" command failed: ${e}`); + vscode.window.showErrorMessage(`"Go: Toggle compiler optimization details" command failed: ${e}`); } }; };