Skip to content

Commit 6c5dc76

Browse files
committed
Flush pending text changes on file save (#262)
1 parent dd5f623 commit 6c5dc76

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

src/clangd-context.ts

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -182,6 +182,12 @@ export class ClangdContext implements vscode.Disposable {
182182
return symbol;
183183
})
184184
},
185+
didSave: async (document, next) => {
186+
if (this.pendingTextChange && this.pendingTextChange.matches(document)) {
187+
await this.flushPendingTextChanges();
188+
}
189+
return await next(document);
190+
},
185191
didChange: async (event, next) => {
186192
if (this.pendingTextChange) {
187193
this.textChangeDelayer.cancel();

0 commit comments

Comments
 (0)