Skip to content

clear module cache on LSP save to avoid polluting context#591

Merged
hexdae merged 5 commits intomainfrom
fix/lsp-cache-stale
Feb 28, 2026
Merged

clear module cache on LSP save to avoid polluting context#591
hexdae merged 5 commits intomainfrom
fix/lsp-cache-stale

Conversation

@hexdae
Copy link
Copy Markdown
Contributor

@hexdae hexdae commented Feb 28, 2026

Note

Medium Risk
Touches evaluation-session caching and LSP save/viewer paths; mistakes could lead to stale/incorrect diagnostics or state, though scope is limited to editor workflows.

Overview
Prevents cross-file contamination in the shared evaluation module_tree by clearing it during EvalContext::parse_and_analyze_file.

Updates the LSP to cache the computed pcb_sch::Schematic (instead of the full EvalOutput) immediately after evaluation, and reuses that schematic for viewer/getState and on_save_diagnostics, clearing the cache on failures and file close.

Written by Cursor Bugbot for commit 34b86cb. This will update automatically on new commits. Configure here.

CHANGELOG.md Outdated
### Fixed

- Normalize net and component symbol source paths to `package://...`, so emitted schematic/netlist `symbol_path` values no longer leak absolute cache paths.
- Fix LSP simulation diagnostics leaking components across unrelated files due to shared module tree state.
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

prob don't need changelog if it was introduced + fixed in same release

Copy link
Copy Markdown

@cursor cursor bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Cursor Bugbot has reviewed your changes and found 1 potential issue.

Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.

@hexdae hexdae merged commit 118a16b into main Feb 28, 2026
12 checks passed
@hexdae hexdae deleted the fix/lsp-cache-stale branch February 28, 2026 21:13
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants