diff --git a/package.json b/package.json index 21847cb03..f54c357a5 100644 --- a/package.json +++ b/package.json @@ -411,6 +411,16 @@ "light": "res/light/clean-configure-icon.svg" } }, + { + "command": "cmake.projectStatus.openSettings", + "title": "%cmake-tools.command.cmake.openSettings.title%", + "when": "cmake:enableFullFeatureSet", + "category": "CMake", + "icon": { + "dark": "res/dark/settings-icon.svg", + "light": "res/light/settings-icon.svg" + } + }, { "command": "cmake.cleanConfigureWithDebugger", "title": "%cmake-tools.command.cmake.cleanConfigureWithDebugger.title%", @@ -656,6 +666,11 @@ "title": "%cmake-tools.command.cmake.resetState.title%", "category": "CMake" }, + { + "command": "cmake.openSettings", + "title": "%cmake-tools.command.cmake.openSettings.title%", + "category": "CMake" + }, { "command": "cmake.outline.runUtilityTarget", "when": "cmake:enableFullFeatureSet", @@ -1001,6 +1016,9 @@ { "command": "cmake.resetState" }, + { + "command": "cmake.openSettings" + }, { "command": "cmake.configureAll", "when": "cmake:multiProject" @@ -1260,6 +1278,10 @@ "command": "cmake.projectStatus.cleanConfigure", "when": "never" }, + { + "command": "cmake.projectStatus.openSettings", + "when": "never" + }, { "command": "cmake.projectStatus.setVariant", "when": "never" @@ -1331,6 +1353,11 @@ "when": "view == cmake.projectStatus && !cmake:isBuilding && !cmake:hideLaunchCommand && cmake:enableFullFeatureSet", "group": "navigation@4" }, + { + "command": "cmake.projectStatus.openSettings", + "when": "view == cmake.projectStatus && cmake:enableFullFeatureSet", + "group": "navigation@5" + }, { "command": "cmake.outline.configureAll", "when": "view == cmake.outline && !cmake:isBuilding", @@ -1398,6 +1425,11 @@ "when": "view == cmake.projectStatus && cmake:enableFullFeatureSet && viewItem == 'cleanConfigure'", "group": "inline" }, + { + "command": "cmake.projectStatus.openSettings", + "when": "view == cmake.projectStatus && cmake:enableFullFeatureSet && viewItem == 'openSettings'", + "group": "inline" + }, { "command": "cmake.projectStatus.setVariant", "when": "view == cmake.projectStatus && cmake:enableFullFeatureSet && viewItem == 'variant'", diff --git a/package.nls.json b/package.nls.json index c309b9afe..8bbb4c75f 100644 --- a/package.nls.json +++ b/package.nls.json @@ -57,6 +57,7 @@ "cmake-tools.command.cmake.stop.title": "Cancel Build", "cmake-tools.command.cmake.stopAll.title": "Cancel Build for All Projects", "cmake-tools.command.cmake.resetState.title": "Reset CMake Tools Extension State (For troubleshooting)", + "cmake-tools.command.cmake.openSettings.title": "Open CMake Tools Extension Settings", "cmake-tools.command.cmake.selectActiveFolder.title": "Select Active Folder", "cmake-tools.command.cmake.outline.runUtilityTarget.title": "Run Utility", "cmake-tools.command.cmake.outline.debugTarget.title": "Debug", diff --git a/res/dark/settings-icon.svg b/res/dark/settings-icon.svg new file mode 100644 index 000000000..075129f20 --- /dev/null +++ b/res/dark/settings-icon.svg @@ -0,0 +1,12 @@ + + + + \ No newline at end of file diff --git a/res/light/settings-icon.svg b/res/light/settings-icon.svg new file mode 100644 index 000000000..2f58e5402 --- /dev/null +++ b/res/light/settings-icon.svg @@ -0,0 +1,12 @@ + + + + \ No newline at end of file diff --git a/src/extension.ts b/src/extension.ts index a9c1e3680..3a381cb93 100644 --- a/src/extension.ts +++ b/src/extension.ts @@ -1472,6 +1472,10 @@ export class ExtensionManager implements vscode.Disposable { void vscode.commands.executeCommand('workbench.action.reloadWindow'); } + async openSettings() { + void vscode.commands.executeCommand('workbench.action.openSettings', '@ext:ms-vscode.cmake-tools'); + } + async viewLog() { telemetry.logEvent("openLogFile"); await logging.showLogFile(); @@ -1840,6 +1844,7 @@ async function setup(context: vscode.ExtensionContext, progress?: ProgressHandle 'selectLaunchTarget', 'setDefaultTarget', 'resetState', + 'openSettings', 'viewLog', 'logDiagnostics', 'compileFile', diff --git a/src/projectStatus.ts b/src/projectStatus.ts index e47262459..f6274ba03 100644 --- a/src/projectStatus.ts +++ b/src/projectStatus.ts @@ -28,6 +28,9 @@ export class ProjectStatus { await runCommand('cleanConfigure'); await this.refresh(); }), + vscode.commands.registerCommand('cmake.projectStatus.openSettings', async(_node: Node) => { + await runCommand('openSettings'); + }), vscode.commands.registerCommand('cmake.projectStatus.selectKit', async (_node: Node) => { await runCommand('selectKit'); await this.refresh();