Fixes 146816

This commit is contained in:
Henning Dieterichs
2022-04-19 16:43:26 +02:00
parent 9be47ee6ab
commit bc5bfa0621

View File

@@ -569,6 +569,7 @@ export class UpdateOperation implements IDisposable {
*/
export class SynchronizedInlineCompletionsCache extends Disposable {
public readonly completions: readonly CachedInlineCompletion[];
private isDisposing = false;
constructor(
completionsSource: TrackedInlineCompletions,
@@ -588,6 +589,7 @@ export class SynchronizedInlineCompletionsCache extends Disposable {
}))
);
this._register(toDisposable(() => {
this.isDisposing = true;
editor.deltaDecorations(decorationIds, []);
}));
@@ -600,7 +602,11 @@ export class SynchronizedInlineCompletionsCache extends Disposable {
this._register(completionsSource);
}
public updateRanges() {
public updateRanges(): void {
if (this.isDisposing) {
return;
}
let hasChanged = false;
const model = this.editor.getModel();
for (const c of this.completions) {