@@ -683,22 +683,15 @@ mutable struct ServerState
683683 # Cache for files not synced via document-synchronization (unsynced files).
684684 # Populated on-demand by `get_unsynced_file_info!`, invalidated by `workspace/didChangeWatchedFiles`.
685685 const unsynced_file_cache:: UnsyncedFileCache
686- # Document symbol cache for both synced and unsynced files.
687- # Uses LWContainer for concurrent writes from:
688- # - `get_document_symbols!` (on cache miss)
689- # - `textDocument/didChange` (invalidates synced files)
690- # - `workspace/didChangeWatchedFiles` (invalidates unsynced files)
686+ # Per-file caches keyed on the canonical (notebook-aware) URI of a logical file.
687+ # All three are dropped together via `invalidate_per_file_caches!` on content change
688+ # (didChange/didOpen, notebook cell edits, watched-file events).
689+ # `binding_occurrences_cache` and `lowering_diagnostics_cache` are additionally
690+ # invalidated by `update_analysis_cache!` when full-analysis changes module context,
691+ # since both embed `binfo.mod`. `lowering_diagnostics_cache` is also cleared wholesale
692+ # on diagnostic-affecting config changes via `clear_lowering_diagnostics_cache!`.
691693 const document_symbol_cache:: DocumentSymbolCache
692- # Binding occurrences cache for global binding analysis (references, rename).
693- # Same invalidation pattern as document_symbol_cache.
694- # TODO : This cache uses analysis context (module context from full-analysis).
695- # It should also be invalidated when full-analysis updates module context,
696- # but that is not yet implemented.
697694 const binding_occurrences_cache:: BindingOccurrencesCache
698- # Per-file cache of the diagnostics produced by `lowering_diagnostics!` over a
699- # file's top-level statements. Lets cross-file `workspace/diagnostic`
700- # invalidations (see `compute_workspace_diagnostic_result_id`) skip re-running
701- # `jl_lower_for_scope_resolution` for files whose own content is unchanged.
702695 const lowering_diagnostics_cache:: LoweringDiagnosticsCache
703696 const analysis_manager:: AnalysisManager
704697 const extra_diagnostics:: ExtraDiagnostics
0 commit comments