Enable Ctrl+S keyboard shortcut in CMake Cache Editor UI#4696
Open
Enable Ctrl+S keyboard shortcut in CMake Cache Editor UI#4696
Conversation
Co-authored-by: hanniavalera <90047725+hanniavalera@users.noreply.github.com>
…gistration Co-authored-by: hanniavalera <90047725+hanniavalera@users.noreply.github.com>
Copilot
AI
changed the title
[WIP] Fix Ctrl+S shortcut not working in CMake Cache Editor
Enable Ctrl+S keyboard shortcut in CMake Cache Editor UI
Feb 3, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This change addresses item #4000
This changes visible behavior
The following changes are proposed:
CustomTextEditorProviderto replace the standaloneWebviewPanelfor the CMake Cache EditorCMakeCache.txtfiles withpriority: "option"so users can choose between text and UI viewseditCacheUI()command to open the cache file with the new custom editor viavscode.openWithcacheEditorWebviewproperty and related refresh logic fromcmakeProject.tsThe purpose of this change
The CMake Cache Editor UI used a regular
WebviewPanelwhich doesn't integrate with VS Code's document save system. Standard save shortcuts (Ctrl+S, File > Save) had no effect—only the Save button in the webview worked.By implementing
vscode.CustomTextEditorProvider, edits in the webview are applied to the underlyingTextDocument, enabling native save functionality. The document dirty state indicator and auto-save also work correctly.Other Notes/Information
Files changed:
src/ui/cmakeCacheEditorProvider.ts— NewCustomTextEditorProviderimplementationsrc/extension.ts— Register the provider afterextensionManagerinitsrc/cmakeProject.ts— SimplifiededitCacheUI()to usevscode.openWithpackage.json— AddedcustomEditorscontribution and activation eventpackage.nls.json— Added display name localizationManual test steps:
CMake: Edit CMake Cache (UI)Warning
Firewall rules blocked me from connecting to one or more addresses (expand for details)
I tried to connect to the following addresses, but was blocked by firewall rules:
0psvsblobprodwus2145.vsblob.vsassets.io/usr/local/bin/node node /usr/local/bin/npm install(dns block)/usr/local/bin/node node /usr/local/bin/npm install --prefer-offline(dns block)2wrvsblobprodwus2180.vsblob.vsassets.io/usr/local/bin/node node /usr/local/bin/yarn install(dns block)40vvsblobprodwus2135.vsblob.vsassets.io/usr/local/bin/node node /usr/local/bin/yarn install(dns block)/usr/local/bin/node node /usr/local/bin/npm install(dns block)/usr/local/bin/node node /usr/local/bin/npm install --prefer-offline(dns block)5bdvsblobprodwus2128.vsblob.vsassets.io/usr/local/bin/node node /usr/local/bin/npm install(dns block)b15vsblobprodwus2164.vsblob.vsassets.io/usr/local/bin/node node /usr/local/bin/yarn install(dns block)b53vsblobprodwus2154.vsblob.vsassets.io/usr/local/bin/node node /usr/local/bin/yarn install(dns block)d94vsblobprodwus2119.vsblob.vsassets.io/usr/local/bin/node node /usr/local/bin/yarn install(dns block)ezcvsblobprodwus2170.vsblob.vsassets.io/usr/local/bin/node node /usr/local/bin/npm install(dns block)/usr/local/bin/node node /usr/local/bin/npm install --prefer-offline(dns block)k4pvsblobprodwus2140.vsblob.vsassets.io/usr/local/bin/node node /usr/local/bin/yarn install(dns block)/usr/local/bin/node node /usr/local/bin/npm install(dns block)n6wvsblobprodwus2123.vsblob.vsassets.io/usr/local/bin/node node /usr/local/bin/yarn install(dns block)p2tvsblobprodwus2189.vsblob.vsassets.io/usr/local/bin/node node /usr/local/bin/yarn install(dns block)v41vsblobprodwus2175.vsblob.vsassets.io/usr/local/bin/node node /usr/local/bin/yarn install(dns block)If you need me to access, download, or install something from one of these locations, you can either:
Original prompt
This section details on the original issue you should resolve
<issue_title>ctrl+s not working in CMake Cache Editor (UI)</issue_title>
<issue_description>### Brief Issue Summary
The shortcut Ctrl+S (or whatever binding is set) does not work in the UI CMake Cache Editor.
Reproduce:
Ctrl+Sor Menu -> File -> SaveNothing happens. I was expecting the document to be saved.
Only the Save button at the top of the document works.
CMake Tools Diagnostics
{ "os": "win32", "vscodeVersion": "1.92.2", "cmtVersion": "1.18.44", "configurations": [ { "folder": "c:\\TechnoTeam\\develop\\src\\TT_CodeBase", "cmakeVersion": "3.29.3", "configured": true, "generator": "Ninja Multi-Config", "usesPresets": true, "compilers": { "C": "C:/Program Files/Microsoft Visual Studio/2022/Professional/VC/Tools/MSVC/14.40.33807/bin/Hostx64/x64/cl.exe", "CXX": "C:/Program Files/Microsoft Visual Studio/2022/Professional/VC/Tools/MSVC/14.40.33807/bin/Hostx64/x64/cl.exe" } } ], "cpptoolsIntegration": { "isReady": true, "hasCodeModel": true, "activeBuildType": "Debug", "buildTypesSeen": [ "Debug", "Release" ], "requests": [], "responses": [], "partialMatches": [], "targetCount": 94, "executablesCount": 5, "librariesCount": 21, "targets": [] }, "settings": [ { "communicationMode": "automatic", "useCMakePresets": "auto", "configureOnOpen": false } ] }Debug Log
No response
Additional Information
Version: 1.92.2 (user setup)
Commit: fee1edb8d6d72a0ddff41e5f71a671c23ed924b9
Date: 2024-08-14T17:29:30.058Z
Electron: 30.1.2
ElectronBuildId: 9870757
Chromium: 124.0.6367.243
Node.js: 20.14.0
V8: 12.4.254.20-electron.0
OS: Windows_NT x64 10.0.22631</issue_description>
<agent_instructions>You are Copilot coding agent acting as a senior maintainer/contributor for the VS Code extension repository microsoft/vscode-cmake-tools.
You are deeply familiar with CMake, CMake Presets, CTest, kit/toolchain selection, VS Code extension APIs, and the architecture of this repo (TypeScript-heavy).
Your job is to resolve the GitHub issue provided below safely and in a maintainable way, matching existing patterns and UX.
SOURCE OF TRUTH
ctrl+s not working in CMake Cache Editor (UI) #4000 - Bug ctrl+s not working in CMake Cache Editor (UI) #4000
NON-NEGOTIABLE PROCESS
✨ Let Copilot coding agent set things up for you — coding agent works faster and does higher quality work when set up for your repo.