diff options
| author | Giga Bowser <45986823+Giga-Bowser@users.noreply.github.com> | 2025-01-20 14:05:19 -0500 |
|---|---|---|
| committer | Giga Bowser <45986823+Giga-Bowser@users.noreply.github.com> | 2025-01-20 14:05:19 -0500 |
| commit | 1d5af89654d69024e1bcf3c326b6c53a6878b511 (patch) | |
| tree | 373ea8b51a76a7396d42928dd65eb12d0f50e801 /src/tools/rust-analyzer/editors/code | |
| parent | ea3897b35ae71e17971055fe376d70cf99e8f1a0 (diff) | |
fix: Only refresh syntax tree view when the active document changes
Diffstat (limited to 'src/tools/rust-analyzer/editors/code')
| -rw-r--r-- | src/tools/rust-analyzer/editors/code/src/ctx.ts | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/src/tools/rust-analyzer/editors/code/src/ctx.ts b/src/tools/rust-analyzer/editors/code/src/ctx.ts index 5550bfa6558..96dc4f19b82 100644 --- a/src/tools/rust-analyzer/editors/code/src/ctx.ts +++ b/src/tools/rust-analyzer/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(); } |
