almost complete update for run configurations

This commit is contained in:
Connor Peet
2021-07-12 17:28:01 -07:00
parent 9a09d4817d
commit fa9255c0de
23 changed files with 472 additions and 164 deletions

View File

@@ -53,14 +53,22 @@ export class ExtHostTesting implements ExtHostTestingShape {
/**
* Implements vscode.test.registerTestProvider
*/
public createTestController(controllerId: string): vscode.TestController {
public createTestController(controllerId: string, label: string): vscode.TestController {
const disposable = new DisposableStore();
const collection = disposable.add(new SingleUseTestCollection(controllerId));
const initialExpand = disposable.add(new RunOnceScheduler(() => collection.expand(collection.root.id, 0), 0));
const configurations = new Map<number, vscode.TestRunConfiguration>();
const proxy = this.proxy;
const controller: vscode.TestController = {
root: collection.root,
get label() {
return label;
},
set label(value: string) {
label = value;
proxy.$updateControllerLabel(controllerId, label);
},
get id() {
return controllerId;
},
@@ -100,13 +108,13 @@ export class ExtHostTesting implements ExtHostTestingShape {
},
};
this.proxy.$registerTestController(controllerId);
disposable.add(toDisposable(() => this.proxy.$unregisterTestController(controllerId)));
proxy.$registerTestController(controllerId, label);
disposable.add(toDisposable(() => proxy.$unregisterTestController(controllerId)));
this.controllers.set(controllerId, { controller, collection, configurations });
disposable.add(toDisposable(() => this.controllers.delete(controllerId)));
disposable.add(collection.onDidGenerateDiff(diff => this.proxy.$publishDiff(controllerId, diff)));
disposable.add(collection.onDidGenerateDiff(diff => proxy.$publishDiff(controllerId, diff)));
return controller;
}
@@ -166,6 +174,11 @@ export class ExtHostTesting implements ExtHostTestingShape {
return Iterable.find(this.runTracker.trackers, t => t.id === runId)?.getCoverage(taskId)?.resolveFileCoverage(fileIndex, token) ?? Promise.resolve([]);
}
/** @inheritdoc */
$configureRunConfig(controllerId: string, configId: number) {
this.controllers.get(controllerId)?.configurations.get(configId)?.configureHandler?.();
}
/**
* Updates test results shown to extensions.
* @override