Revert "fix: memory leak in abstract task service" (#291306)

Revert "fix: memory leak in abstract task service (#289863)"

This reverts commit d50d600239.
This commit is contained in:
Megan Rogge
2026-01-28 10:48:01 -05:00
committed by GitHub
parent c721687d36
commit 921274364e
@@ -8,8 +8,8 @@ import { IStringDictionary } from '../../../../base/common/collections.js';
import { Emitter, Event } from '../../../../base/common/event.js';
import * as glob from '../../../../base/common/glob.js';
import * as json from '../../../../base/common/json.js';
import { Disposable, DisposableMap, DisposableStore, dispose, IDisposable, IReference, MutableDisposable } from '../../../../base/common/lifecycle.js';
import { LRUCache, ResourceMap, Touch } from '../../../../base/common/map.js';
import { Disposable, DisposableStore, dispose, IDisposable, IReference, MutableDisposable } from '../../../../base/common/lifecycle.js';
import { LRUCache, Touch } from '../../../../base/common/map.js';
import * as Objects from '../../../../base/common/objects.js';
import { ValidationState, ValidationStatus } from '../../../../base/common/parsers.js';
import * as Platform from '../../../../base/common/platform.js';
@@ -106,14 +106,13 @@ export namespace ConfigureTaskAction {
export type TaskQuickPickEntryType = (IQuickPickItem & { task: Task }) | (IQuickPickItem & { folder: IWorkspaceFolder }) | (IQuickPickItem & { settingType: string });
class ProblemReporter extends Disposable implements TaskConfig.IProblemReporter {
class ProblemReporter implements TaskConfig.IProblemReporter {
private _validationStatus: ValidationStatus;
private readonly _onDidError: Emitter<string> = this._register(new Emitter<string>());
private readonly _onDidError: Emitter<string> = new Emitter<string>();
public readonly onDidError: Event<string> = this._onDidError.event;
constructor(private _outputChannel: IOutputChannel) {
super();
this._validationStatus = new ValidationStatus();
}
@@ -259,7 +258,6 @@ export abstract class AbstractTaskService extends Disposable implements ITaskSer
private _activatedTaskProviders: Set<string> = new Set();
private readonly notification = this._register(new MutableDisposable<DisposableStore>());
private readonly _workspaceTaskDisposables: DisposableMap<URI, IDisposable> = this._register(new DisposableMap(new ResourceMap()));
constructor(
@IConfigurationService private readonly _configurationService: IConfigurationService,
@@ -2645,10 +2643,8 @@ export abstract class AbstractTaskService extends Disposable implements ITaskSer
}
await ProblemMatcherRegistry.onReady();
const taskSystemInfo: ITaskSystemInfo | undefined = this._getTaskSystemInfo(workspaceFolder.uri.scheme);
const store = new DisposableStore();
this._workspaceTaskDisposables.set(workspaceFolder.uri, store);
const problemReporter = store.add(new ProblemReporter(this._outputChannel));
store.add(problemReporter.onDidError(error => this._showOutput(runSource, undefined, error)));
const problemReporter = new ProblemReporter(this._outputChannel);
this._register(problemReporter.onDidError(error => this._showOutput(runSource, undefined, error)));
const parseResult = TaskConfig.parse(workspaceFolder, undefined, taskSystemInfo ? taskSystemInfo.platform : Platform.platform, workspaceFolderConfiguration.config, problemReporter, TaskConfig.TaskConfigSource.TasksJson, this._contextKeyService);
let hasErrors = false;
if (!parseResult.validationStatus.isOK() && (parseResult.validationStatus.state !== ValidationState.Info)) {
@@ -2671,7 +2667,6 @@ export abstract class AbstractTaskService extends Disposable implements ITaskSer
this._logService.warn('Custom workspace tasks are not supported.');
}
return { workspaceFolder, set: { tasks: this._jsonTasksSupported ? parseResult.custom : [] }, configurations: customizedTasks, hasErrors };
}
private _testParseExternalConfig(config: TaskConfig.IExternalTaskRunnerConfiguration | undefined, location: string): { config: TaskConfig.IExternalTaskRunnerConfiguration | undefined; hasParseErrors: boolean } {