Merge pull request #18989 from Giga-Bowser/syntax-tree-refresh

fix: Only refresh syntax tree view when the active document changes
This commit is contained in:
Lukas Wirth 2025-01-21 07:23:22 +00:00 committed by GitHub
commit 6291e1d611
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

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