nes: fix: dispose RejectionCollector (#744)

This commit is contained in:
Ulugbek Abdullaev
2025-08-25 11:40:56 +02:00
committed by GitHub
parent 724183bf9f
commit dc3d13ad31
3 changed files with 4 additions and 4 deletions
@@ -13,7 +13,7 @@ import { StringEdit, StringReplacement } from '../../../util/vs/editor/common/co
import { StringText } from '../../../util/vs/editor/common/core/text/abstractText';
export class RejectionCollector extends Disposable {
private readonly _garbageCollector = new LRUGarbageCollector(20);
private readonly _garbageCollector = this._register(new LRUGarbageCollector(20));
private readonly _documentCaches = new Map<DocumentId, DocumentRejectionTracker>();
private readonly _tracer: ITracer;
@@ -62,7 +62,7 @@ export class NextEditProvider extends Disposable implements INextEditProvider<Ne
public readonly ID = this._statelessNextEditProvider.ID;
private readonly _rejectionCollector = new RejectionCollector(this._workspace, s => this._logService.trace(s));
private readonly _rejectionCollector = this._register(new RejectionCollector(this._workspace, s => this._logService.trace(s)));
private readonly _nextEditCache: NextEditCache;
private readonly _recentlyShownCache = new RecentlyShownCache();
@@ -199,7 +199,7 @@ export class DiagnosticsCompletionProcessor extends Disposable {
return providers;
}).recomputeInitiallyAndOnChange(this._store);
this._rejectionCollector = new RejectionCollector(this._workspace, s => this._tracer.trace(s));
this._rejectionCollector = this._register(new RejectionCollector(this._workspace, s => this._tracer.trace(s)));
const isValidEditor = (editor: vscode.TextEditor | undefined): editor is vscode.TextEditor => {
return !!editor && (isNotebookCell(editor.document.uri) || isEditorFromEditorGrid(editor));
@@ -700,4 +700,4 @@ class DiagnosticsCompletionHandlerTelemetry {
hasAlternativeDiagnosticForSameRange: this._hasAlternativeDiagnosticForSameRange
};
}
}
}