Skip to content

Commit

Permalink
Fixes #188348 (#188372)
Browse files Browse the repository at this point in the history
  • Loading branch information
hediet authored Jul 20, 2023
1 parent 32511c4 commit 6f21bd8
Showing 1 changed file with 7 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -221,7 +221,13 @@ export class UpToDateInlineCompletions implements IDisposable {
public dispose(): void {
this._refCount--;
if (this._refCount === 0) {
this.textModel.deltaDecorations(this._inlineCompletions.map(i => i.decorationId), []);
setTimeout(() => {
// To fix https://github.com/microsoft/vscode/issues/188348
if (!this.textModel.isDisposed()) {
// This is just cleanup. It's ok if it happens with a delay.
this.textModel.deltaDecorations(this._inlineCompletions.map(i => i.decorationId), []);
}
}, 0);
this.inlineCompletionProviderResult.dispose();
for (const i of this._prependedInlineCompletionItems) {
i.source.removeRef();
Expand Down

0 comments on commit 6f21bd8

Please sign in to comment.