Expand description
LSP-owned editor-bus events (M.5.3.b).
Three concrete event types replacing the LSP variants that
used to live in the central lattice_protocol::Event enum.
Each registers via [lattice_protocol::register_event!] so
:describe-events (M.5.3.c) and any future event-introspection
tooling sees them. The editor’s
[lattice_runtime::EventBus::publish_typed] /
[lattice_runtime::EventBus::subscribe_typed] surface dispatches
and downcasts.
Why these live here: the central Event enum was a single
sealed type that every feature crate had to edit to publish.
Moving LSP events to lattice-lsp puts them under their
owner’s authority – same model lattice-mode uses for the
Mode trait.
Structs§
- LspActor
Exited - Fired when an actor task exits (4.4.d). The supervisor
subscribes to this event to drive crash-detection
auto-restart:
Cleanexits (after aShutdowncommand) are ignored;Unexpectedexits trigger the supervisor’s restart-with-backoff path. The supervisor is the single subscriber today; plugin telemetry can subscribe later without further plumbing. - LspBuffer
Attached - Fired after
lsp-modeactivates on a buffer and the supervisor has queued thetextDocument/didOpen. The semantic counterpart to LSP’s didOpen on the editor’s bus: the buffer is now LSP-tracked. Subscribers (statusline, future plugin hooks, telemetry) react without pollingApp::active_modes. - LspBuffer
Detached - Fired when
lsp-modedeactivates on a buffer and the supervisor has senttextDocument/didCloseto attached servers. The buffer remains open in the editor; only LSP tracking ends. Server connection persists if other buffers are still attached. - LspCode
Lens Refresh - 4.5.d: server-issued
workspace/codeLens/refreshrequest surfaces as this typed bus event. Same shape as the other refresh events; the App-side drain evicts cached code lenses for every buffer attached to the requesting server. - LspDiagnostic
Refresh - 4.4.j: fired when an attached server requests
workspace/diagnostic/refresh. The host invalidates the pull-diagnosticsresult_idcache for every buffer attached to this server; the next render tick re-issuestextDocument/diagnostic(without aprevious_result_id, so the server must answer with aFullreport) and theDiagnosticsLayerre-applies. - LspDocument
Changed - Fired when a document buffer changes and
lsp-modeis active for that buffer (M.5.5). The per-actor fan-in (crate::fan_in) subscribes viaEventBus::subscribe_typed::<LspDocumentChanged>and forwards eachAppliedEditas aRecordEditactor command. - LspInlay
Hint Refresh - 4.4.g: fired when an attached server requests
workspace/inlayHint/refresh. The host invalidates every cached inlay-hint entry for buffers attached to this server; the next render tick re-issuesinlayHintand repopulates. - LspLog
Pushed - Fired when
crate::LspLogger::logappends a record to a log ring (subsystem-wide whenserver_idisNone, per-server otherwise). Subscribers (the App’s drain hook) refresh open*lsp*/*lsp:<server>*/*lsp:<server>:trace*help buffers from the logger snapshot so log views update live as records arrive. - LspProgress
Update - Fired when an attached server sends a
$/progressnotification (LSP §3.16 work-done progress). The host accumulates progress entries by (server_id, token) and surfaces the most recent active one in the modeline. - LspSemantic
Tokens Refresh - 4.4.i: fired when an attached server requests
workspace/semanticTokens/refresh. The host invalidates every cached semantic-tokens entry for buffers attached to this server; the next render tick re-issuessemanticTokens/full(forcing a fresh baseline rather than a delta against a now-staleresult_id) and repopulates. - LspServer
Status Changed - L2: fired when a server sends
experimental/serverStatus(rust-analyzer’s readiness extension).quiescentis the gold-standard “ready” signal –falsewhile the server is scanning / indexing,trueonce it has finished and features (hover, diagnostics, completion) are reliable.healthis the server’s self-assessed condition. The host turns this into the modeline’s ✓/⟳/✗ readiness glyph.