Skip to content

Update API changes that add methods with command result information#4518

Merged
gcampbell-msft merged 27 commits intomainfrom
dev/gcampbell/UpdateApi
Jul 29, 2025
Merged

Update API changes that add methods with command result information#4518
gcampbell-msft merged 27 commits intomainfrom
dev/gcampbell/UpdateApi

Conversation

@gcampbell-msft
Copy link
Collaborator

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 refreshTests that, before this PR, we only stored in this.tests our current tests in the branch logic where the CMake version was 3.14 or beyond. This would make our support for our listTests API 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 listTests API.

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.

itodirel
itodirel previously approved these changes Jul 22, 2025
@itodirel itodirel requested a review from moyo1997 July 22, 2025 22:09
@gcampbell-msft gcampbell-msft force-pushed the dev/gcampbell/UpdateApi branch from 3368b46 to 5a4a2d4 Compare July 29, 2025 14:29
@gcampbell-msft gcampbell-msft merged commit 232c28e into main Jul 29, 2025
4 checks passed
@gcampbell-msft gcampbell-msft deleted the dev/gcampbell/UpdateApi branch July 29, 2025 20:40
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants