pub struct CompletionPipeline {
pub generators: Vec<Arc<dyn CandidateGenerator>>,
pub matcher: Arc<dyn CandidateMatcher>,
pub rankers: Vec<Arc<dyn CandidateRanker>>,
pub annotators: Vec<Arc<dyn CandidateAnnotator>>,
}Expand description
One assembled pipeline for a single completion query. Built by the registry’s slot resolver (or hand-built for tests).
Slice 3c.unify.ranker-stack: the ranker slot is now a Vec
so dimensions can compose. Each ranker in rankers runs in
registration order, re-sorting the scored candidates by its
own dimension. The downstream renderer sees the result of the
LAST ranker — the chain shape is “earlier ranker establishes
baseline ordering, later rankers refine within that”. A future
MruRanker will live alongside the builtin ScoreRanker
without either becoming aware of the other.
Fields§
§generators: Vec<Arc<dyn CandidateGenerator>>§matcher: Arc<dyn CandidateMatcher>§rankers: Vec<Arc<dyn CandidateRanker>>§annotators: Vec<Arc<dyn CandidateAnnotator>>Implementations§
Source§impl CompletionPipeline
impl CompletionPipeline
Sourcepub fn run(
&self,
ctx: &GenerateContext<'_>,
query: &str,
cache: &GeneratorCache,
) -> Vec<RenderedCandidate>
pub fn run( &self, ctx: &GenerateContext<'_>, query: &str, cache: &GeneratorCache, ) -> Vec<RenderedCandidate>
Run every stage. cache is the registry’s shared cache; the
pipeline reads from / writes to it on the generator stage
only. Matcher / ranker / annotators run live every call.
Source§impl CompletionPipeline
impl CompletionPipeline
Sourcepub fn match_and_rank(
&self,
query: &str,
raw: &[RawCandidate],
) -> Vec<RenderedCandidate>
pub fn match_and_rank( &self, query: &str, raw: &[RawCandidate], ) -> Vec<RenderedCandidate>
Slice 3c.unify.picker-via-pipeline: shared match+rank
entry point for surfaces that have pre-computed candidates
and want the shared matcher + ranker machinery without
the generator / annotator ceremony.
Used by:
- Picker (
Picker::refilter): pre-suppliesrawviaPicker::set_raw_candidates_*; pipeline holds picker- specific matcher (FuzzyDisplayMatcher) and rankers (MruRankerover the picker’s bonus map). - LSP picker sources (future, slices 10-16): host pre-supplies rows from async LSP responses; pipeline holds the same picker shape.
Skips the generator stage (callers have raw already) and
the annotator stage (callers without annotation pipelines
don’t pay for it). Annotation-enabled callers can call
the full Pipeline::run once they have a GenerateContext,
or extend this method to take an annotators slice when a
concrete need surfaces.
Source§impl CompletionPipeline
Helper that assembles a pipeline from the registry’s current
configuration plus the slot’s generator. Returns None if any
required piece (default matcher / default ranker / the
generator) is missing – callers surface that as “completion
not configured for this slot”.
impl CompletionPipeline
Helper that assembles a pipeline from the registry’s current
configuration plus the slot’s generator. Returns None if any
required piece (default matcher / default ranker / the
generator) is missing – callers surface that as “completion
not configured for this slot”.