Expand description
Language services — completion, signature help, hover.
In-process, no LSP. Each service is one small trait defined here in the
core and satisfied by the app — not a god-trait with no-op defaults; a
service ruled out of scope is simply not built. The plain data the traits
exchange lives here too, so a provider never reaches an editor internal.
Completion is synchronous by contract (the classifier is a regex
ladder over a few dozen lines — microseconds), so the widget calls the
provider in update() and opens the popup from the returned Vec the same
frame; no async reply, no revision guard.
The controller state machines (completion / snippet session) that consume these providers are core view-state and land in the submodules below.
Modules§
- completion
- The completion controller state machine — core view-state, driven by
the widget and headlessly tested against a stub provider. It owns the popup
list, local prefix filtering, Escape-stickiness, and the provider-call budget
(at most one
complete()per input event); it never touches the document. Accepting returns the chosen item for the caller to apply as one sealed transaction. - hover
- Hover — the
Hovertrait the app satisfies plus the plain data it returns. Like the other language services it is synchronous by contract: a hover query is an in-memory lookup keyed by the word under the pointer, so the widget calls it on the mouse-idle tick and renders the reply the same frame. Because the answer is produced synchronously there is no reply envelope and nothing in flight, so a reply can never arrive stale. - providers
- The completion provider contract: the
Completionstrait the app satisfies, plus the plain-data types it exchanges. Every type here is inert data — no editor internal is reachable from a provider. - signature
- Signature help — the
SignatureHelptrait the app satisfies plus the plain data it returns. No controller: signature help is stateless per query (the app re-runs it on(/,/ edits and shows or hides the one-line box from the reply), so unlike completion there is no sticky state machine. - snippet
- The snippet parser: the LSP placeholder subset
spec.rsemits, parsed into a body with defaults expanded plus an ordered list of tab stops. Pure text — no document, no transaction; the session state machine that drives the decoration store consumes this. Items stay inert data until accept time, so parsing happens then, never earlier.