Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 3 additions & 4 deletions src/vs/workbench/contrib/tasks/browser/taskProblemMonitor.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
* Licensed under the MIT License. See License.txt in the project root for license information.
*--------------------------------------------------------------------------------------------*/

import { Disposable, DisposableStore } from '../../../../base/common/lifecycle.js';
import { Disposable, DisposableMap, DisposableStore } from '../../../../base/common/lifecycle.js';
import { AbstractProblemCollector } from '../common/problemCollectors.js';
import { ITerminalInstance } from '../../terminal/browser/terminal.js';
import { URI } from '../../../../base/common/uri.js';
Expand All @@ -17,7 +17,7 @@ interface ITerminalMarkerData {
export class TaskProblemMonitor extends Disposable {

private readonly terminalMarkerMap: Map<number, ITerminalMarkerData> = new Map();
private readonly terminalDisposables: Map<number, DisposableStore> = new Map();
private readonly terminalDisposables = new DisposableMap<number>();

constructor() {
super();
Expand All @@ -34,8 +34,7 @@ export class TaskProblemMonitor extends Disposable {

store.add(terminal.onDisposed(() => {
this.terminalMarkerMap.delete(terminal.instanceId);
this.terminalDisposables.get(terminal.instanceId)?.dispose();
this.terminalDisposables.delete(terminal.instanceId);
this.terminalDisposables.deleteAndDispose(terminal.instanceId);
}));

store.add(problemMatcher.onDidFindErrors((markers: ITaskMarker[]) => {
Expand Down