mirror of
https://github.com/microsoft/vscode.git
synced 2026-04-23 18:19:12 +01:00
@@ -55,7 +55,7 @@ export class ExtHostTesting implements ExtHostTestingShape {
|
||||
/**
|
||||
* Implements vscode.test.registerTestProvider
|
||||
*/
|
||||
public createTestController(controllerId: string, label: string): vscode.TestController {
|
||||
public createTestController(controllerId: string, label: string, refreshHandler?: () => Thenable<void> | void): vscode.TestController {
|
||||
if (this.controllers.has(controllerId)) {
|
||||
throw new Error(`Attempt to insert a duplicate controller with ID "${controllerId}"`);
|
||||
}
|
||||
@@ -75,7 +75,14 @@ export class ExtHostTesting implements ExtHostTestingShape {
|
||||
set label(value: string) {
|
||||
label = value;
|
||||
collection.root.label = value;
|
||||
proxy.$updateControllerLabel(controllerId, label);
|
||||
proxy.$updateController(controllerId, { label });
|
||||
},
|
||||
get refreshHandler() {
|
||||
return refreshHandler;
|
||||
},
|
||||
set refreshHandler(value: (() => Thenable<void> | void) | undefined) {
|
||||
refreshHandler = value;
|
||||
proxy.$updateController(controllerId, { canRefresh: !!value });
|
||||
},
|
||||
get id() {
|
||||
return controllerId;
|
||||
@@ -109,10 +116,7 @@ export class ExtHostTesting implements ExtHostTestingShape {
|
||||
},
|
||||
};
|
||||
|
||||
// back compat:
|
||||
(controller as any).createRunConfiguration = controller.createRunProfile;
|
||||
|
||||
proxy.$registerTestController(controllerId, label);
|
||||
proxy.$registerTestController(controllerId, label, !!refreshHandler);
|
||||
disposable.add(toDisposable(() => proxy.$unregisterTestController(controllerId)));
|
||||
|
||||
const info: ControllerInfo = { controller, collection, profiles: profiles };
|
||||
@@ -178,6 +182,11 @@ export class ExtHostTesting implements ExtHostTestingShape {
|
||||
this.controllers.get(controllerId)?.profiles.get(profileId)?.configureHandler?.();
|
||||
}
|
||||
|
||||
/** @inheritdoc */
|
||||
async $refreshTests(controllerId: string) {
|
||||
await this.controllers.get(controllerId)?.controller.refreshHandler?.();
|
||||
}
|
||||
|
||||
/**
|
||||
* Updates test results shown to extensions.
|
||||
* @override
|
||||
|
||||
Reference in New Issue
Block a user