Skip to content

Commit

Permalink
Flush pending text changes on file save (#262)
Browse files Browse the repository at this point in the history
  • Loading branch information
strpbrk committed Dec 4, 2021
1 parent dd5f623 commit 2eb2f09
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions src/clangd-context.ts
Original file line number Diff line number Diff line change
Expand Up @@ -182,6 +182,12 @@ export class ClangdContext implements vscode.Disposable {
return symbol;
})
},
didSave: async (document, next) => {
if (this.pendingTextChange && this.pendingTextChange.matches(document)) {
await this.flushPendingTextChanges();
}
await next(document);
},
didChange: async (event, next) => {
if (this.pendingTextChange) {
this.textChangeDelayer.cancel();
Expand Down

0 comments on commit 2eb2f09

Please sign in to comment.