One authority.
Flow and algorithm
Platform spec article
Flow and algorithm
Spec standingStandard
-
Hub authority
Context
Decision
Hub owns snapshot/refresh MUST/SHOULD.
Consequences
IDE parity.
Verification anchors
beskid_lsp tests.
-
Invalidation
Context
Stale snapshots.
Decision
Invalidate on focus, manifest, lock; debounce watchers.
Consequences
Config notification.
Verification anchors
session store.
- Contracts and edge cases Strict guarantees for LSP snapshot lifecycle and refresh behavior.
- Design model Conceptual model for `Snapshot and refresh contract` and its subsystem boundaries.
- Examples Observable LSP refresh scenarios for snapshots and diagnostics.
- FAQ and troubleshooting Common LSP snapshot and refresh issues.
- Flow and algorithm End-to-end refresh flow for LSP workspace snapshots and diagnostics.
- Verification and traceability Tests and traceability for the LSP snapshot and refresh contract.
0 revisions (git unavailable at build; counts may be empty)
No commits recorded for this path.
| Section id | Required | Found |
|---|---|---|
what-this-feature-specifies | yes | yes |
implementation-anchors | yes | yes |
Full tree: run pnpm verify:platform-spec-layout (writes src/generated/platform-spec-layout-report.json).
Open document refresh
Section titled “Open document refresh”sequenceDiagram
participant Editor
participant LSP as beskid_lsp
participant Analysis as beskid_analysis
Editor->>LSP: didChange (incremental)
LSP->>LSP: apply_document_changes
LSP->>LSP: text_hash unchanged?
alt changed
LSP->>Analysis: cached_compilation_context
LSP->>Analysis: build_document_analysis_with_context
LSP->>LSP: schedule_publish_diagnostics (120ms debounce)
end
LSP-->>Editor: publishDiagnostics
- Apply LSP content changes to the open
Document. - If text hash unchanged and version monotonic, skip re-analysis.
- Otherwise rebuild
DocumentAnalysisSnapshotusing cachedCompilationContext. - Coalesce diagnostic publish jobs per URI revision counter.
Workspace scan algorithm
Section titled “Workspace scan algorithm”scan_workspace(root, focused_project):
- Walk directory tree, skipping
.git,target,node_modules,.beskid,out,bin,obj,.vs. - Collect
.bdand manifest paths; cap concurrent reads (MAX_CONCURRENT_READS = 24). - Call
invalidate_compilation_cachebefore indexing when graph scope may have changed. - For each path,
analyze_documentor hydrate disk snapshot viaset_disk_snapshotwhen not open. - Emit progress every 25 files or 200ms; finish with
phase: idle.
Focused project URI steers which Project.proj seeds CompilationContext when a source file has ambiguous workspace membership.
External disk change
Section titled “External disk change”refresh_after_disk_change and hydrate_disk_after_close re-read closed files into workspace_index without clobbering open buffers. Manifest edits trigger cache invalidation then a full or scoped rescan from backend.rs configuration handlers.
Feature requests and snapshots
Section titled “Feature requests and snapshots”IDE features (completion, hover, definition, …) snapshot document text through protocol/request.rs helpers so handlers observe a consistent parse tree for the debounced generation.
compiler/crates/beskid_tests/src/analysis/resolve.rs covers resolver behavior consumed by LSP project context; extend LSP-specific tests when changing invalidation or scan skip rules.