-
Notifications
You must be signed in to change notification settings - Fork 30.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[Testing]: Get selected default Run/Debug TestProfile(s) #193160
Comments
I propose the following additional APIs: export namespace tests {
/**
* The list of {@link TestRunProfile} the user has selected as their default
* profiles when running tests.
*/
// implementors's note: for a given extension, this shows only the
// TestRunProfiles that extension has created
export let activeTestRunProfiles: readonly TestRunProfile[];
/**
* Fired when a user has changed their default test run profiles. The
* new value is also reflected in {@link activeTestRunProfiles}.
*/
export const onDidChangeActiveTestRunProfiles: Event<readonly TestRunProfile[]>;
} |
Sync-Feedback
|
Updated API, will be available to try out in the next Insiders: declare module 'vscode' {
export interface TestRunProfile {
/**
* Whether this profile is currently selected as a default by the user
*/
readonly isSelected: boolean;
/**
* Fired when a user has changed whether this is a selected profile. The
* event contains the new value of {@link isSelected}
*/
onDidChangeSelected: Event<boolean>;
}
} @mxschmitt please try it out and let us know if it works for you! |
testing: implement proposed active profiles api For #193160
I tried it out and it works for us! (We just check then if isSelected is true rather than attaching to the event listener.) |
@connor4312 is this only about the default run profile or generally when selecting a profile w/o running it? |
This is about the profile the user has selected as their chosen profile to be used when clicking the "run" or "debug" buttons. |
Also, got in-person confirmation last week from @mxschmitt that this API is good for playwright :) |
Yea, that's right. The confusing thing is that we already has an extension-definable One kind of clever thing we could do, though it's questionably breaking, is to have |
I like that |
So in that case I would revise this proposal with only the additional property in the .d.ts, along with docs changes: declare module 'vscode' {
export interface TestRunProfile {
/**
* Fired when a user has changed whether this is a default profile. The
* event contains the new value of {@link isDefault}
*/
onDidChangeDefault: Event<boolean>;
}
} |
Is it possible to get the currently selected default run profile(s)? In this case the first and last.
We tried RunProfile.isDefault, but thats not getting the needed updates from the user when he selects/de-selects.
Thanks!
The text was updated successfully, but these errors were encountered: