The February release of CMake Tools in VS Code is now available. With this release, we have some new updates to the extension to improve CMake integrations with the extension’s support.
Some updates include the built-in support for CMake Language services, addressing our most highly-upvoted issues in the CMake Tools extension, and CMake presets v9 support. To view the full list of updates with this release, please look at our CHANGELOG.
This release features the following nine contributions from our open-source community. Thank you for your continued support!
- Adding support to configure default folder in workspace setting by @sanore
- Improving test output for error and skipped tests by @redstrate
- Adding a setting to skip project re-build before CTest by @dabsunter
- Ability to pass custom target to CMake: Build Target by @hippo91
- Fixing issue where setting CTest suite delimiter prevented execution of all tests by hippo91
- Fixing issue where GCC linker errors did not show up in Problems View by @0xemgy
- Fixing compilation database path comparison with cmake.copyCompileCommands by @k0zmo
- Fixing configure preset detection issue when referenced in workflow preset by CMakeUserPresets.json by @nikobockerman
- Fixing issue where select active folder did not work when having the same name as the project by @mnastmÂ
Built-in support for CMake Language Services
Our highest upvoted issues in the CMake Tools extension (184 votes!) was to provide in-house support for language services for CMake.
We have begun our work to fully integrate IntelliSense directly into the CMake Tools extension. This includes integrations for colorization and quick info for CMake built-ins, now directly available with the CMake Tools extension, removing the dependency on the out-of-date twxs extension.
What are CMake Language Services?
These are rich IntelliSense features that provide code completions and member lists within CMakeLists.txt files and other CMake scripts, giving you quick access to view all applicable CMake scripting features.
CMake language services offer rich syntax highlighting for CMakeLists.txt and other CMake script files, which is in-line with other programming languages like C++.
Within these CMake files, users can access detailed information about any built-in CMake variables by hovering over them, making CMake development easier to understand.
CMake Presets v9 Support
We now support CMake presets v9, which allows you to use all macros except $env{} macros in the include field of a preset.
For example, if you want to specify your CMakePresets.json to include other files not hardcoded, using the path to the directory containing the preset file which contains the macro, you’ll be able to run the following CMake presets JSON specifications at the top of your file.
 "version": 9,  "cmakeMinimumRequired": {   "major": 3,   "minor": 30,   "patch": 0  },  "include": ["${fileDir}"],  "configurePresets":...
What’s Next?
We have a lot of exciting new things planned for 1.21, including adding even more enhancements to our CMake language services and improvements to multi-root workspace configurations in our extension. You can view our plans any time via our GitHub project view.
What do you think?
Download Visual Studio Code and let us know what you think. We would love to see what you contribute to our repo and we are active on reviews and collaboration. Please create an issue if there’s anything you’d like to see and upvote/downvote any existing issues. Comment below or reach us via email at visualcpp@microsoft.com or via X at @VisualC.
Is “CMake Language Services” an LSP server for CMake? What’s the difference between “intellisense” and LSP?
Right now, we are at the basic level of CMake language services, which is similar to IntelliSense as it provides code suggestions and completions for CMake code.
We still have work to be done to have a full LSP server for CMake, as our language services only provide support for built-ins. The remaining work can be tracked through this GH issue: https://github.com/microsoft/vscode-cmake-tools/issues/4261