fix: Only refresh syntax tree view when the active document changes

This commit is contained in:
Giga Bowser 2025-01-20 14:05:19 -05:00
parent ea3897b35a
commit 1d5af89654

View file

@ -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();
}