HoneaDevWrx Logo HoneaDevWrx Documentation
Developer Tools • Visual Studio Code Integration

Synchronize CMakeVis with Visual Studio Code & CMake Tools

Launch CMake repositories and subprojects directly from the VS Code Explorer, Editor Title bars, or Status Bar with automatic ms-vscode.cmake-tools configure preset handoff and workspace change monitoring.

CMakeVis and Visual Studio Code Integration

Contents

1. Companion Extension Capabilities

2. Installation, Packaging & Executable Discovery

Option A: Package & Install Locally (.vsix)

From the vscode-extension/ directory of the CMakeVis distribution:

cd vscode-extension
npx @vscode/vsce package
code --install-extension cmakevis-vscode-0.1.0.vsix

Alternatively, install through the Visual Studio Code interface: Extensions (Ctrl+Shift+X) → ... → Install from VSIX...

Option B: Run in Extension Development Host (F5)

Open the CMakeVis workspace in Visual Studio Code, select CMakeVis VS Code Extension: Launch Extension Host in Run and Debug (Ctrl+Shift+D), and press F5.

Executable Discovery Order

  1. User setting cmakevis.executablePath (when non-empty and pointing to a valid executable on disk).
  2. Workspace or sibling build output directories (src/CMakeVis/bin/Release/.../CMakeVis.exe on Windows, src/CMakeVis.Linux/bin/.../CMakeVis.Linux on Linux).
  3. System PATH and standard installation directories (%LocalAppData%\Programs\CMakeVis\CMakeVis.exe, %ProgramFiles%\CMakeVis\CMakeVis.exe, /usr/bin/cmakevis).

If the CMakeVis binary cannot be resolved automatically on initial invocation, the extension prompts with a native file selector and persists the selected path to global cmakevis.executablePath.

3. Command Palette Reference

Command Identifier Command Title Description
cmakevis.openDesigner CMakeVis: Open Visual CMake Designer Opens the nearest root CMake workspace in CMakeVis using the active CMake Tools configure preset.
cmakevis.openFolderInCMakeVis CMakeVis: Open Folder / Subproject in CMakeVis Opens the selected folder or CMakeLists.txt parent directory in CMakeVis.
cmakevis.selectPresetAndOpen CMakeVis: Pick CMake Preset & Open Designer Lists non-hidden configure presets from CMakePresets.json / CMakeUserPresets.json, applies the selection in CMake Tools, and launches CMakeVis.
cmakevis.syncCMakeTools CMakeVis: Refresh CMake Tools from CMakeVis Changes Updates the status bar preset badge and invokes cmake.configure within VS Code CMake Tools.

4. Configuration Settings

Setting Key Type & Default Description
cmakevis.executablePath string ("") Explicit filesystem path to CMakeVis.exe (Windows) or CMakeVis / CMakeVis.Linux (Linux).
cmakevis.passActiveCMakeToolsPreset boolean (true) Forwards --preset <name> from VS Code CMake Tools when launching CMakeVis.
cmakevis.autoSyncCMakeTools boolean (true) Monitors **/CMakeLists.txt, CMakePresets.json, CMakeUserPresets.json, and vcpkg.json and triggers cmake.configure automatically when CMake Tools is active (debounced at 600ms).
{
  "cmakevis.executablePath": "C:\\Program Files\\CMakeVis\\CMakeVis.exe",
  "cmakevis.passActiveCMakeToolsPreset": true,
  "cmakevis.autoSyncCMakeTools": true
}

5. Bi-Directional CMakeVis ↔ Visual Studio Code Workflow

  1. Open a repository in Visual Studio Code with CMake Tools set to a configure preset such as windows-clang-debug.
  2. Select CMakeVis (windows-clang-debug) in the status bar to launch CMakeVis with windows-clang-debug pre-selected in the Preset Designer and Build ribbon.
  3. Modify targets, wire library dependencies, adjust compiler flag tokens, or refine preset inheritance, then select Export CMake or Save Presets.
  4. The companion extension detects updated CMakeLists.txt or CMakePresets.json files on disk (debounced) and automatically refreshes VS Code CMake Tools.
  5. From any compiler entry in CMakeVis's Diagnostics drawer or any file listed in Target Information, select VS Code to jump directly to the exact source location via code -g file:line.

6. CMakeVis CLI Reference

Flag Description
--open <path> Loads the specified CMake workspace directory at startup in place of the empty canvas.
--preset <name> Activates the designated configure preset immediately after loading the workspace.
--self-test Executes an automated headless verification cycle across all six workspace tabs and exits.
--self-test --screenshot <png> Pairs with --self-test to export a rendered 1400×900 PNG snapshot of the dependency graph canvas before exiting.