Add pinned/favorite CMake cache variables to Project Status panel#4787
Draft
Add pinned/favorite CMake cache variables to Project Status panel#4787
Conversation
Add support for pinning frequently changed CMake cache variables directly in the cmake.projectStatus tree view. Users can: - Pin cache variables from a quick-pick of all known cache variables - Edit pinned variable values inline (updates cmake.configureSettings) - Unpin variables with an inline remove button Pinned variables are stored in workspace state (project-local). Values are read live from the CMake cache on each refresh. Fixes #3463 Co-authored-by: hanniavalera <90047725+hanniavalera@users.noreply.github.com>
…pin icon Co-authored-by: hanniavalera <90047725+hanniavalera@users.noreply.github.com>
Copilot
AI
changed the title
[WIP] Add favorites functionality for cmake cache variables
Add pinned/favorite CMake cache variables to Project Status panel
Mar 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 #3463
This changes visible behavior
Users with parametric projects (e.g., firmware parameterized by
HARDWARE_IDandPRODUCT_ID) can now pin frequently changed CMake cache variables directly in the Project Status sidebar for inline editing, instead of opening the full Cache Editor UI or relying on build tasks/terminal.The following changes are proposed:
PinnedCacheVariablesNode/PinnedCacheVariableNodeto thecmake.projectStatustree view, rendered between Configure and Build nodes when variables are pinnedcmake.projectStatus.pinCacheVariable(quick-pick from cache),editPinnedCacheVariable(input box → updatescmake.configureSettings, respectsconfigureOnEdit),unpinCacheVariable$(edit)and unpin$(close)buttons per variableworkspaceState(project-local, not committed to source); values read live from the CMake cache on each refreshextensionContextfromExtensionManager→ProjectStatus→TreeDataProviderfor workspace state accessworkspaceFolderOther Notes/Information
settings.json— storage is workspace state only.INTERNALandSTATICcache entry types from the pin quick-pick, matching the existing Cache Editor UI behavior.Original prompt
This section details on the original issue you should resolve
<issue_title>Add "favorites" functionality for frequently changed cmake cache variables</issue_title>
<issue_description>### Brief Issue Summary
My workplace project is parametrized by two cache variables:
Having cmake variant for each identifier pair gets quickly out of hand, so having the dropdowns for both values on cmake sidebar, somewhere near project outline, is desired.
I could just go to cmake cache ui each time, but currently calling build tasks which set one of the vars or typing that in integrated terminal is faster, although the build task list also gets bigger and bigger, and terminal approach is not that discoverable for my workplace colleagues.
CMake Tools Diagnostics
No response
Debug Log
No response
Additional Information
No response</issue_description>
<agent_instructions>## Feature: Pinned / Favorite CMake Cache Variables in the Project Status Panel
Context
In
microsoft/vscode-cmake-tools, the CMake Project Status sidebar panel (cmake.projectStatustree view) already exposes key build settings as inline-editable tree items: kit, variant, configure preset, build preset, build target, test preset, launch target, etc.Users with parametric projects (e.g., firmware with
HARDWARE_IDandPRODUCT_IDcache variables) currently have no fast, discoverable way to change a small number of frequently-tweaked CMake cache variables short of opening the full Cache Editor UI (cmake.editCacheUI), adding proliferating build tasks, or typing in the terminal. This is mentioned in #3463 - #3463Goal
Add support for pinned/favorite CMake cache variables surfaced as inline-editable items directly inside the existing
cmake.projectStatustree view — not as a new standalone tree view — to minimize sidebar real estate impact. Make sure that there is no visual clutter.The experience should feel like the existing kit/preset rows: a label showing the variable name + current value, with an inline
$(edit)action that opens a quick-pick or input box to change the value (and re-triggers configure ifcmake.configureOnEditis true).What to explore and implement - this is merely a suggestion, take it somewhat with a grain of salt
Storage: Where should the list of pinned variable names be persisted?
context.workspaceState) so it's project-local and not committed to source.cmake.pinnedCacheVariablessetting (array of strings) insettings.json.Data model: After configure, the extension already reads the CMake cache (see
cmakeProject.ts/codeModel). Pinned variable items should read their current value live from the cache model, not store the value themselves.Tree view integration: Add a new
viewItemcontext key (e.g.,'pinnedCacheVar') to the existingcmake.projectStatusTreeDataProvider. Items should appear in a logical location — after the configure preset row and before the build preset row is a reasonable default. They should:VAR_NAME: current_value$(edit)button → triggerscmake.projectStatus.setPinnedCacheVariablecommand$(remove)button → removes the variable from the pinned listCommands to implement:
cmake.pinnedCacheVariables.pin— show a quick-pick of all known cache variables (from the cache model) and add the selected one to the pinned listcmake.projectStatus.setPinnedCacheVariable— triggered from the inline edit button; show input box pre-filled with current value; on confirm, callcmake -D VAR=VALUEor updatecmake.configureSettingsand re-configurecmake.pinnedCacheVariables.unpin— remove a variable from the pinned list (also accessible via inline remove button)UX constraints:
cmake.projectStatusonly.$(add)icon) when the list is empty, wired tocmake.pinnedCacheVariables.pin.cmake.projectStatusview title action bar (next to the existing settings/refresh icons).Configure-on-change: After the user sets a new value, the extension should apply it consistently with how
cmake.configureSettingsoverrides work, and respectcmake.configureOnEdit.Files likely to touch
src/cmakeProject.ts— cache variable readingsrc/ui/projectStatus.ts(or equivalent tree provider) — add new tree itemspackage.json— new c...✨ Let Copilot coding agent set things up for you — coding agent works faster and does higher quality work when set up for your repo.