Expand description
The four pluggable traits the pipeline composes.
Each is its own extension point. Plugins (post-WASM) register
impls against the crate::CompletionRegistry just like they
register commands or keymaps. Default impls ship as built-ins
(crate::builtins::*).
Structs§
- Generate
Context - Snapshot of editor state a generator may need to consult. Held by reference so the pipeline borrows from the surrounding frame for the duration of the call. Generators that don’t need buffer or registry state simply ignore those fields.
Traits§
- Candidate
Annotator - Decorates a candidate with display metadata (right-side text in
the popup – marginalia’s role). Multiple annotators are active
simultaneously; they run in registration order, each appending
a typed
crate::Annotationtocandidate.annotations. The renderer paints each annotation with the style its category resolves to and joins consecutive annotations with two spaces. - Candidate
Generator - Produces raw candidates for a slot. Implementations vary from
pure (
gen:commandswalks the registry) to side-effecting (gen:filesreads the filesystem). Caching is opt-in viaSelf::cache_key– the default is “no cache”. - Candidate
Matcher - Matches and scores candidates against a query string. The
default v1 matcher (
match:prefix) returnsSomeonly when the query is a prefix ofcandidate.text. Thefuzzymatcher (orderless-equivalent) returns sub-character match ranges and a score that decays with skipped chars. - Candidate
Ranker - Reorders the matched + scored candidate set. The default
(
rank:score) sorts by descending score;rank:alphabeticalis an alternative. Plugin rankers can implement frecency, recency, smart-case ordering, etc.