Skip to content

Commit 6f21bd8

Browse files
authored
1 parent 32511c4 commit 6f21bd8

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

src/vs/editor/contrib/inlineCompletions/browser/inlineCompletionsSource.ts

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -221,7 +221,13 @@ export class UpToDateInlineCompletions implements IDisposable {
221221
public dispose(): void {
222222
this._refCount--;
223223
if (this._refCount === 0) {
224-
this.textModel.deltaDecorations(this._inlineCompletions.map(i => i.decorationId), []);
224+
setTimeout(() => {
225+
// To fix https://github.com/microsoft/vscode/issues/188348
226+
if (!this.textModel.isDisposed()) {
227+
// This is just cleanup. It's ok if it happens with a delay.
228+
this.textModel.deltaDecorations(this._inlineCompletions.map(i => i.decorationId), []);
229+
}
230+
}, 0);
225231
this.inlineCompletionProviderResult.dispose();
226232
for (const i of this._prependedInlineCompletionItems) {
227233
i.source.removeRef();

0 commit comments

Comments
 (0)