Update API changes that add methods with command result information#4518
Merged
gcampbell-msft merged 27 commits intomainfrom Jul 29, 2025
Merged
Update API changes that add methods with command result information#4518gcampbell-msft merged 27 commits intomainfrom
gcampbell-msft merged 27 commits intomainfrom
Conversation
temp
…g but seems to work from an API perspective in a small test project and also CMake repo
gcampbell-msft
commented
Jul 17, 2025
bobbrow
reviewed
Jul 21, 2025
itodirel
previously approved these changes
Jul 22, 2025
moyo1997
reviewed
Jul 22, 2025
…t/vscode-cmake-tools into dev/gcampbell/UpdateApi
3368b46 to
5a4a2d4
Compare
moyo1997
approved these changes
Jul 29, 2025
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 implements the API changes suggested/made in this PR: microsoft/vscode-cmake-tools-api#10.
Important changes things to note
Backwards-compatibility
This is designed to be backwards compatible with older versions of the API by simply adding methods. While the new parameters are optional and the return type can be ignored which would make this back-compat, the pre-existing methods threw an error if they hit a non-zero return code. If this is changed, users may be broken and be forced to update to this version.
@benmcmorran @bobbrow @laurenprinn @moyo1997 @paulmaybee Let me know what you think about this, it may be acceptable to simply add a non-void return type, add optional parameters to the current methods.
Storage of tests
This adds the ability to "cache" our tests for retrieval even when the CMake version is an older. You'll notice in ctest.cs
refreshTeststhat, before this PR, we only stored inthis.testsour current tests in the branch logic where the CMake version was 3.14 or beyond. This would make our support for ourlistTestsAPI depend on whether you had a more recent version of CMake. To solve this, we also store the "legacy" tests if it's an older version of CMake.Refreshing of tests
This modifies our logic to allow for refreshing of tests even if the Test Explorer integration is turned off. This allows for our support of the
listTestsAPI.Wider support of cancellation of commands
This adds the ability to cancel commands through our API. To support this, the ability to combine multiple cancellation tokens into one was added so that we can handle cancellation through the API or through the UI at the same time.
The purpose of this change
Implements the changes made in the above linked PR. This adds the ability, through the extension API to be able to build, configure, clean, install, and reconfigure and get the result information (return code, stdout, and stderr) returned to you. Additionally, it lets you list the current build targets and current tests available.