Skip to content

Commit 6291e1d

Browse files
authored
Merge pull request #18989 from Giga-Bowser/syntax-tree-refresh
fix: Only refresh syntax tree view when the active document changes
2 parents ea3897b + 1d5af89 commit 6291e1d

File tree

1 file changed

+8
-1
lines changed
  • src/tools/rust-analyzer/editors/code/src

1 file changed

+8
-1
lines changed

src/tools/rust-analyzer/editors/code/src/ctx.ts

+8-1
Original file line numberDiff line numberDiff line change
@@ -361,7 +361,14 @@ export class Ctx implements RustAnalyzerExtensionApi {
361361
}
362362
});
363363

364-
vscode.workspace.onDidChangeTextDocument(async () => {
364+
vscode.workspace.onDidChangeTextDocument(async (e) => {
365+
if (
366+
vscode.window.activeTextEditor?.document !== e.document ||
367+
e.contentChanges.length === 0
368+
) {
369+
return;
370+
}
371+
365372
if (this.syntaxTreeView?.visible) {
366373
await this.syntaxTreeProvider?.refresh();
367374
}

0 commit comments

Comments
 (0)