Skip to content

1.24.42

Latest

Choose a tag to compare

@hanniavalera hanniavalera released this 11 Sep 17:29
22fc2be

Features:

  • Add support for the FASTBuild generator (CMake 4.2+). #4690
  • Add support for ${workspaceFolder}, ${workspaceFolder:name} variables and relative paths in cmake.exclude setting for multi-root workspaces. #4689
  • Add onConfigureResult event to the CMake Tools API that fires after every configure attempt (success or failure), allowing dependent extensions to detect and react to configure failures. #4021
  • Add cmake.preConfigureTask setting to execute a named VS Code task before every CMake configure. #2449 #4960 @erdemiru

Improvements:

  • Add ${testName} variable support for cmake.ctestArgs and cmake.ctestDefaultArgs, enabling per-test argument expansion (e.g., unique log file paths per test). #4416
  • Stop the CMake output channel from taking over the panel (hiding the terminal you're working in) during automatic configures (e.g. configure-on-open and automatic reconfigure) and programmatic builds or tests invoked through the CMake Tools API (e.g. by Copilot via the C/C++ DevTools companion). Failures are still always shown, explicit user-initiated builds/configures are unchanged, and cmake.revealLogOnAutomaticTrigger restores the old behavior. #4988
  • Add cmake.showTimestampsInOutput setting to display timestamps and log levels in the CMake output channel, useful for tracking build durations. #4057
  • When CMake is invoked prior to running tests, build targets required for the test rather than everything. #4515 @epistax
  • Allow building object library targets from the project outline. #4797
  • Add inline "Run" and "Debug" CodeLens buttons in source editors for tests discovered by CTest, allowing tests to be executed directly from their source locations. #4451
  • Improve responsiveness to CMake path changes made by vendor extensions during configure-on-open retry. #4908 Contributed by STMicroelectronics
  • Improve ergonomics of the test explorer UI by removing the project source directory, improving horizontal scrolling experience. #4562 @miss-programgamer
  • Pass mandatory compiler arguments from CMAKE_<LANG>_COMPILER to cpptools so it can properly determine system include paths and built-in preprocessor macro definitions. Requires CMake 4.3 or newer. #4627 @cwalther
  • Add support for a vsInstanceVersion vendor field in CMakePresets.json so Ninja configure presets can target a specific installed Visual Studio instance (by version) when bootstrapping the developer environment, instead of always using the latest. #4698
  • Use the CMake bundled with the Visual Studio instance selected by the vsInstanceVersion vendor field when resolving cmake.exe, instead of always falling back to the latest installed Visual Studio's CMake. Only applies on Windows for presets that pin an instance and when no explicit cmake.cmakePath or preset cmakeExecutable is set; otherwise CMake resolution is unchanged. #5052
  • Make the CMake Cache Editor ("Edit Cache (UI)") aware of cache variables defined by the active CMake configure preset: a new "Source" column shows where each variable comes from (project/user preset vs. the CMake cache) and whether it still matches the preset, and edits to preset-backed variables are now persisted as an override in CMakeUserPresets.json (and reconfigured with it) instead of being silently reverted by the preset on the next configure. #4884 @BilboBeutlin89
  • Load the bundled language-service data (command, variable, module, and policy descriptions) on first hover/completion instead of during activation, so activation no longer blocks on reading those assets. #5035
  • Replace the datalist/input control with a select control for enum-valued cache entries in the CMake Cache Editor, so allowed values are chosen from a proper dropdown instead of a free-text field. #4973

Bug Fixes:

  • Fix "Scan recursively for kits in specific directories" aborting with an unhandled EACCES/EPERM error (and adding no kits) when the chosen folder contains a subdirectory the current user cannot read (for example a root-only /opt/rh/.../root/root on a WSL/Linux host). Unreadable directories and un-stat-able entries are now skipped so the rest of the scan still completes. #5020
  • Fix the last compiler diagnostic of an IAR build being dropped from the Problems panel. The IAR output parser only emitted a diagnostic once a following line arrived, so the final one of each build (with no trailing line) was never flushed; parsers are now flushed when the build output ends. #5030
  • Fix a cmake build/configure task (a tasks.json entry with "type": "cmake") always operating on the first CMake project in a workspace folder that hosts several projects (for example multiple cmake.sourceDirectory entries) instead of the selected active folder. Such a task now honors the active project when it belongs to the task's workspace folder, and only falls back to the folder's project otherwise. #4512
  • Fix launch configurations that use ${cmake.testProgram} (and the related ${cmake.testArgs}, ${cmake.testWorkingDirectory} and ${cmake.testEnvironment} placeholders) failing with program '${cmake.testProgram}' does not exist when started from the Run and Debug view (F5) instead of the Test Explorer. Such a launch now prompts you to pick one of the discovered CTest tests and resolves the placeholders for it, so the same configuration works from both entry points. #4574
  • Fix disabled tests (for example GoogleTest DISABLED_ tests, which CTest reports as "Not Run (Disabled)") being shown in the Test Explorer as failed ("failed with completion status 'Disabled'") and dragging their group's status down. Such tests are intentionally not executed, so they are now reported as skipped and no longer taint the run result. #4267
  • Fix CMake syntax highlighting treating escaped $< sequences in quoted regex strings as generator expressions. #5028
  • Fix the Test Explorer reporting a test that crashed or timed out (for example one killed by a segmentation fault) as "failed with exit code 0". CTest records the cause in its Exit Code measurement (such as SEGFAULT or Timeout) while Exit Value stays 0, so the failure message now names that status instead of the misleading exit value. #5043
  • Fix the cmake version/capabilities probe, configure, build, and CMake script debugger intermittently failing (for example No version is set for shim: cmake) for users whose cmake comes from a directory-based version manager (mise, asdf, vfox, …). These CMake subprocesses now run in the project directory instead of inheriting the extension host's working directory, so the version-manager shim on PATH resolves the correct cmake for the project regardless of how the editor was launched. #5005 @danieleformichelli
  • Fix the auto-detected source directory notification showing a literal Change\u2026 on its button instead of Change... in packaged (Marketplace) builds. The label used a \u2026 JavaScript unicode escape, which vscode-nls-dev extracted verbatim into the localization bundle; it now uses plain .... #5003
  • Fix a test run that matched no tests being reported as success. When specific tests are requested (e.g. programmatically via the API/Copilot) but none match a discovered test — for example an agent passing a partial or non-existent test name — CTest exits 0 ("No tests were found!!!"), which callers could misread as "all tests passed". Such runs now return a failure with a clear message when tests exist but the requested ones weren't found. #4915
  • Stop showing "Adding a file without a valid code model" / "Deleting a file without a valid code model" warning notifications when a source file is automatically added or deleted and there is no valid CMake code model (for example when using clangd with the C/C++ IntelliSense engine disabled, or before the project has been configured). The automatic list-file update now stays silent in this case; the warning is only shown when the update is explicitly invoked via the "CMake: Add new source file" / "CMake: Remove deleted source file" commands. #5009
  • Fix running a single test from the inline Test CodeLens or the project outline building the default (or all) target instead of the test's own executable; single-test runs now build only that test's target.
  • Fix a single test's "Run" action in a multi-project workspace running all tests for that project instead of just the selected test, caused by test information from the most recently refreshed project overwriting the shared state used to compute the test filter. #4911
  • Fix test results showing a bare "The test case did not report any output." when a test did not actually run (for example when its executable was not built, so CTest reported it as "Not Run" or matched nothing). The test is now marked with an actionable message explaining that the executable may not have been built. CTest result parsing was also hardened so that compressed test output is decoded and a single test with missing or empty measurements no longer discards the results of the whole run. #4451
  • Fix test runs launched from the Test Explorer or the inline Test CodeLens appearing to run forever (the progress spinner never cleared) when a step in the run failed. The test run is now always finalized, even when building or running the tests throws, so the spinner stops and the failure is reported. Also, a single-test run no longer accidentally executes the entire suite when the full list of tests is not yet known. #4451
  • Fix a regression (since 1.23) where configure could appear to never finish — the progress indicator kept spinning and a second configure was rejected with "Configuration is already in progress" — after CMake had actually completed. Configure-time compiler version telemetry now reads the compiler id/version from the CMake File-API toolchains data instead of launching the compiler, so configure no longer depends on an extra compiler subprocess that could leave a descendant (e.g. mspdbsrv.exe/VCTIP.exe on Windows) holding its output pipes open. #4647
  • Fix CMake Tools not activating for projects whose CMakeLists.txt lives in a subdirectory (e.g. source/CMakeLists.txt) rather than the workspace root. Such projects now activate on open: a single nested CMakeLists.txt is detected and adopted automatically (with a notification to change the choice or opt out), and a picker is offered when there are multiple candidates. The new cmake.autoDetectSourceDirectory setting (default true) controls this behavior.
  • Fix switching the active editor to a file in a different root in a multi-root workspace clearing all C/C++ IntelliSense translation units (including for files still open in other panes). Changing the active project no longer tells cpptools that every file's configuration changed, so it no longer discards and rebuilds translation units for unrelated files. #4964
  • Fix the automatic "Select a Kit" prompt in a multi-root workspace being titled for, and applied to, the folder of the active editor instead of the folder whose configure-on-open actually triggered it. The kit is now selected for the correct project, so the intended folder gets configured and the prompt stops re-appearing on every window reload. #5011
  • Fix cmake.configureOnOpen performing a clean reconfigure (deleting CMakeCache.txt) instead of an incremental configure when using __unspec__ kit with CMake >= 3.15 and no explicit generator setting. #4956
  • Fix ${command:cmake.launchTargetPath} and related substitution commands (cmake.launchTargetDirectory, cmake.launchTargetFilename, cmake.launchTargetName, cmake.getLaunchTargetPath, etc.) showing an error instead of prompting kit or preset selection when none is active. These commands now behave consistently with the build/configure commands by displaying the quick pick dialog.
  • Fix intermittent Failed to parse cmake-tools-kits.json error caused by reading the kits file during a non-atomic write. readKitsFile now returns undefined when the file is empty or unparseable, and callers retain the previous kits in memory instead of clearing them. The file watcher will re-read once the write completes. #4833
  • Fix CMake: Compile Active File by unescaping compile_commands.json command strings into raw argv before spawning the compiler, so defines such as -DCMAKE_INTDIR=\"RelWithDebInfo\" are passed correctly. Originally surfaced on Ninja Multi-Config (Windows); also covers shell-escaped databases from bear, intercept-build, etc. #4935
  • Fix mirrored cursor in CMake control structure snippets. Completing a scoped command (e.g., function, if, foreach) no longer duplicates typed text into the end-statement. #4480
  • Fix CPack package preset inheritance so child variables maps now keep parent-defined -D values when the child adds its own package variables. #4924
  • Fix Windows presets auto-detection so Ninja configure presets without explicit compiler cache variables can still bootstrap the Visual Studio developer environment when appropriate.
  • Fix cmake-kits.json cmakeSettings rejecting boolean values. The JSON schema and the Kit.cmakeSettings TypeScript type now accept boolean (and number) again, so "BUILD_TESTING": true produces -DBUILD_TESTING:BOOL=TRUE and is shown as a checkbox in the CMake Cache Editor. #4927
  • Fix cmakeSettings (in cmake-kits.json) and cmake.configureSettings (workspace settings, including the settings block in CMake variants files) injecting \; into string values such as CMAKE_PREFIX_PATH. String values are now passed through verbatim so ; keeps its natural CMake list-separator semantics — matching how CMake Presets cacheVariables already behaves — completing the fix originally requested in #4503. #4934
  • Fix CMAKE_MAKE_PROGRAM and other cache variables using stale values when presets are edited without restarting VS Code. The onCodeModelChanged subscription is now established in startNewCMakeDriver so it applies to both initial creation and driver reloads. #4864
  • Fix Windows backslash handling in token splitting to preserve trailing backslashes before whitespace. This caused "Compile Active File" with MSVC + Ninja Multi-Config to merge adjacent flags (e.g., /Fd<dir>\ /FS) into a single malformed argument. #4902
  • Skip the automatic post-build CTest discovery when cmake.ctest.testExplorerIntegrationEnabled is false. #4909
  • Fix kit detection returning "unknown vendor" when using clang-cl compiler. #4638
  • Fix CMakeToolsApi.getProject() treating file URIs as source directories, which could log "sourceDirectory" is not a directory during normal API usage from dependent extensions. #4951
  • Fix CMake command-name completion no longer auto-triggering while typing, a regression since 1.23.51. A command word is tokenized as a string until () is added, and the completion provider relies on editor.quickSuggestions (which is off in strings by default), so suggestions stopped appearing. The extension now enables quick suggestions in strings for CMake files via configurationDefaults, restoring the previous behavior (overridable per user). #4959
  • Fix the Problems panel failing to open a file ("file was not found") for GCC C++ template errors. The GNU ld output parser no longer mis-captures a compiler file:line:column: required from here backtrace line as a diagnostic whose resource was file:line (with the source line appended to the path). #4954
  • Fix GNU LD diagnostic regex incorrectly matching CMake status lines (e.g., Zephyr build output) as linker errors in the Problems panel. #4910
  • Fix CTest discovery in the Test Explorer not applying environment variables from the selected test preset. #4313
  • Show the CMake Tools activity-bar view immediately with an "initializing" placeholder instead of hiding the entire sidebar until CMake, kit, preset, and Visual Studio developer-environment probing completes. On machines where those probes are intermittently slow (e.g. aggressive antivirus scanning of spawned processes, or extension-host file-handle exhaustion), the sidebar no longer disappears for minutes during activation. Project commands, menus, and status items remain gated on full readiness, so nothing runs against a partially-initialized project. #5027
  • Refresh the open CMake Cache Editor when configuration changes cache values externally. #3635
  • Avoid building the project multiple times when a single launch.json configuration uses several ${command:cmake.launchTargetPath}-style substitutions (e.g. cmake.launchTargetDirectory plus cmake.launchTargetPath). All such substitutions in one launch now share a single build; a later launch still rebuilds as needed. #5051
  • Preserve CMakeCache.txt on folder open with CMake Presets when the active configure preset specifies no generator, so cmake.configureOnOpen performs an incremental configure instead of deleting the cache and reconfiguring from scratch. #5049
  • Stop checking user kits for missing compilers on every activation, and no longer treat transient filesystem errors (such as file-handle exhaustion) as a missing compiler, which could prompt to remove valid kits. Stale kits are still detected during a kit/compiler scan. #5035
  • Avoid configuring a project twice during configure-on-open when a configure preset (or kit) has to be selected first. The selection no longer performs its own automatic reconfigure when the configure that requested the selection is about to run. #5050
  • Fix clicking "Run Test" (or build/launch) with an unsaved CMakeLists.txt failing with "Configuration is already in progress" and requiring a second click. The automatic reconfigure triggered by saving the file no longer races the command's own configure. #4794
  • Stop passing CMake configure diagnostic flags that CMake 4.4 deprecated (--no-warn-unused-cli, --warn-uninitialized, -Wdev/-Wno-dev, -Werror=dev/-Wno-error=dev), which caused a deprecation warning on every configure. On CMake 4.4 and newer these are emitted using the modern category-based spellings (-Wno-unused-cli, -Wuninitialized, -Wauthor/-Wno-author, -Werror=author/-Wno-error=author); older CMake versions continue to receive the legacy flags. #4999
  • Fix cmake.copyCompileCommands failing with "EISDIR: illegal operation on a directory" when set to a directory path, and emptying compile_commands.json when set to the source file itself. A directory destination now receives the file copied into it, and a destination that resolves to the source file is skipped. #4062