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 9aa0ee1bba
commit c272bcdb69

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