Skip to content

Commit

Permalink
vscode: cache inlay hints before switching files, microsoft/vscode#16…
Browse files Browse the repository at this point in the history
…221 (comment)

Commit: 08a0f239267941699472d6662cdbd685c69bcd26
  • Loading branch information
Johannes Rieken authored and sourcegraph-bot committed Jan 20, 2022
1 parent d8b78ad commit ad09e8c
Showing 1 changed file with 6 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -138,6 +138,12 @@ export class InlayHintsController implements IEditorContribution {
if (cached) {
this._updateHintsDecorators([model.getFullModelRange()], cached);
}
this._sessionDisposables.add(toDisposable(() => {
// cache items when switching files etc
if (!model.isDisposed()) {
this._cacheHintsForFastRestore(model);
}
}));

let cts: CancellationTokenSource | undefined;
let watchedProviders = new Set<languages.InlayHintsProvider>();
Expand Down

0 comments on commit ad09e8c

Please sign in to comment.