mirror of
https://github.com/microsoft/vscode.git
synced 2026-04-24 02:28:34 +01:00
testing: refactor to avoid complex object in ext host comms
For #140975
This commit is contained in:
@@ -21,7 +21,7 @@ import { InvalidTestItemError, TestItemImpl, TestItemRootImpl } from 'vs/workben
|
||||
import * as Convert from 'vs/workbench/api/common/extHostTypeConverters';
|
||||
import { TestRunProfileKind, TestRunRequest } from 'vs/workbench/api/common/extHostTypes';
|
||||
import { SingleUseTestCollection } from 'vs/workbench/contrib/testing/common/ownedTestCollection';
|
||||
import { AbstractIncrementalTestCollection, CoverageDetails, IFileCoverage, IncrementalChangeCollector, IncrementalTestCollectionItem, InternalTestItem, ISerializedTestResults, ITestItem, RunTestForControllerRequest, TestResultState, TestRunProfileBitset, TestsDiff } from 'vs/workbench/contrib/testing/common/testCollection';
|
||||
import { AbstractIncrementalTestCollection, CoverageDetails, IFileCoverage, IncrementalChangeCollector, IncrementalTestCollectionItem, InternalTestItem, ISerializedTestResults, ITestItem, RunTestForControllerRequest, TestResultState, TestRunProfileBitset, TestsDiff, TestsDiffOp } from 'vs/workbench/contrib/testing/common/testCollection';
|
||||
import { TestId, TestIdPathParts, TestPosition } from 'vs/workbench/contrib/testing/common/testId';
|
||||
import type * as vscode from 'vscode';
|
||||
|
||||
@@ -123,7 +123,7 @@ export class ExtHostTesting implements ExtHostTestingShape {
|
||||
this.controllers.set(controllerId, info);
|
||||
disposable.add(toDisposable(() => this.controllers.delete(controllerId)));
|
||||
|
||||
disposable.add(collection.onDidGenerateDiff(diff => proxy.$publishDiff(controllerId, diff)));
|
||||
disposable.add(collection.onDidGenerateDiff(diff => proxy.$publishDiff(controllerId, diff.map(TestsDiffOp.serialize))));
|
||||
|
||||
return controller;
|
||||
}
|
||||
@@ -220,8 +220,8 @@ export class ExtHostTesting implements ExtHostTestingShape {
|
||||
* Receives a test update from the main thread. Called (eventually) whenever
|
||||
* tests change.
|
||||
*/
|
||||
public $acceptDiff(diff: TestsDiff): void {
|
||||
this.observer.applyDiff(diff);
|
||||
public $acceptDiff(diff: TestsDiffOp.Serialized[]): void {
|
||||
this.observer.applyDiff(diff.map(TestsDiffOp.deserialize));
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -460,7 +460,7 @@ class TestRunTracker extends Disposable {
|
||||
return;
|
||||
}
|
||||
|
||||
const chain: ITestItem[] = [];
|
||||
const chain: ITestItem.Serialized[] = [];
|
||||
const root = this.dto.colllection.root;
|
||||
while (true) {
|
||||
const converted = Convert.TestItem.from(test as TestItemImpl);
|
||||
|
||||
Reference in New Issue
Block a user