Skip to content

document-symbol: Cache symbols for unsynced files#484

Merged
aviatesk merged 2 commits intomasterfrom
unsynced-symbol-cache
Jan 16, 2026
Merged

document-symbol: Cache symbols for unsynced files#484
aviatesk merged 2 commits intomasterfrom
unsynced-symbol-cache

Conversation

@aviatesk
Copy link
Owner

@aviatesk aviatesk commented Jan 16, 2026

Enable document symbol caching for files not currently open in the editor (unsynced files with version == 0). Previously, only synced files used the cache, causing repeated parsing for workspace symbol searches.

Also changes DocumentSymbolCache from SWContainer to LWContainer to ensure thread-safe concurrent writes. Since message handlers run concurrently, the cache can be written to from multiple sources simultaneously:

  • textDocument/didChange invalidates cache for synced files
  • workspace/didChangeWatchedFiles invalidates cache for unsynced files
  • get_document_symbols! writes on cache miss

SWContainer does not protect against concurrent writes, so updates could be lost. LWContainer uses lock-serialized writes to ensure correctness.

Enable document symbol caching for files not currently open in the
editor (unsynced files with `version == 0`). Previously, only synced
files used the cache, causing repeated parsing for workspace symbol
searches.
Change `DocumentSymbolCache` from `SWContainer` to `LWContainer` to
ensure thread-safe concurrent writes. Since message handlers run
concurrently, the cache can be written to from multiple sources
simultaneously:
- `textDocument/didChange` invalidates cache for synced files
- `workspace/didChangeWatchedFiles` invalidates cache for unsynced files
- `get_document_symbols!` writes on cache miss

`SWContainer` does not protect against concurrent writes, so updates
could be lost. `LWContainer` uses lock-serialized writes to ensure
correctness.
@codecov
Copy link

codecov bot commented Jan 16, 2026

Codecov Report

❌ Patch coverage is 23.52941% with 13 lines in your changes missing coverage. Please review.
✅ Project coverage is 67.38%. Comparing base (a6689f1) to head (5a65d31).
⚠️ Report is 1 commits behind head on master.

Files with missing lines Patch % Lines
src/document-symbol.jl 10.00% 9 Missing ⚠️
src/did-change-watched-files.jl 42.85% 4 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##           master     #484      +/-   ##
==========================================
+ Coverage   67.37%   67.38%   +0.01%     
==========================================
  Files          46       46              
  Lines        6528     6531       +3     
==========================================
+ Hits         4398     4401       +3     
  Misses       2130     2130              
Flag Coverage Δ
JETLS.jl 67.38% <23.52%> (+0.01%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@aviatesk aviatesk merged commit bfd2389 into master Jan 16, 2026
11 of 13 checks passed
@aviatesk aviatesk deleted the unsynced-symbol-cache branch January 16, 2026 10:58
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.

1 participant