Revert "testing: fix profile id reuse not working"

This reverts commit 0f6d61a0d3.
This commit is contained in:
meganrogge
2022-03-02 21:15:40 -06:00
parent e6aed97dce
commit e24d577022

View File

@@ -95,7 +95,9 @@ export class ExtHostTesting implements ExtHostTestingShape {
profileId++;
}
return new TestRunProfileImpl(this.proxy, profiles, controllerId, profileId, label, group, runHandler, isDefault, tag);
const profile = new TestRunProfileImpl(this.proxy, controllerId, profileId, label, group, runHandler, isDefault, tag);
profiles.set(profileId, profile);
return profile;
},
createTestItem(id, label, uri) {
return new TestItemImpl(controllerId, id, label, uri);
@@ -873,7 +875,6 @@ class TestObservers {
export class TestRunProfileImpl implements vscode.TestRunProfile {
readonly #proxy: MainThreadTestingShape;
#profiles?: Map<number, vscode.TestRunProfile>;
private _configureHandler?: (() => void);
public get label() {
@@ -924,7 +925,6 @@ export class TestRunProfileImpl implements vscode.TestRunProfile {
constructor(
proxy: MainThreadTestingShape,
profiles: Map<number, vscode.TestRunProfile>,
public readonly controllerId: string,
public readonly profileId: number,
private _label: string,
@@ -934,8 +934,6 @@ export class TestRunProfileImpl implements vscode.TestRunProfile {
public _tag: vscode.TestTag | undefined = undefined,
) {
this.#proxy = proxy;
this.#profiles = profiles;
profiles.set(profileId, this);
const groupBitset = profileGroupToBitset[kind];
if (typeof groupBitset !== 'number') {
@@ -954,10 +952,7 @@ export class TestRunProfileImpl implements vscode.TestRunProfile {
}
dispose(): void {
if (this.#profiles?.delete(this.profileId)) {
this.#profiles = undefined;
this.#proxy.$removeTestProfile(this.controllerId, this.profileId);
}
this.#proxy.$removeTestProfile(this.controllerId, this.profileId);
}
}