Unnamed repository; edit this file 'description' to name the repository.
Diffstat (limited to 'editors/code/src/ctx.ts')
-rw-r--r--editors/code/src/ctx.ts9
1 files changed, 8 insertions, 1 deletions
diff --git a/editors/code/src/ctx.ts b/editors/code/src/ctx.ts
index 5550bfa655..96dc4f19b8 100644
--- a/editors/code/src/ctx.ts
+++ b/editors/code/src/ctx.ts
@@ -361,7 +361,14 @@ export class Ctx implements RustAnalyzerExtensionApi {
}
});
- vscode.workspace.onDidChangeTextDocument(async () => {
+ vscode.workspace.onDidChangeTextDocument(async (e) => {
+ if (
+ vscode.window.activeTextEditor?.document !== e.document ||
+ e.contentChanges.length === 0
+ ) {
+ return;
+ }
+
if (this.syntaxTreeView?.visible) {
await this.syntaxTreeProvider?.refresh();
}