Skip to main content

CompletionPipeline

Struct CompletionPipeline 

Source
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

Source

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

Source

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-supplies raw via Picker::set_raw_candidates_*; pipeline holds picker- specific matcher (FuzzyDisplayMatcher) and rankers (MruRanker over 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”.

Source

pub fn for_generator( registry: &CompletionRegistry, generator: GeneratorId, ) -> Option<Self>

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

§

impl<T> Instrument for T

§

fn instrument(self, span: Span) -> Instrumented<Self> ⓘ

Instruments this type with the provided [Span], returning an Instrumented wrapper. Read more
§

fn in_current_span(self) -> Instrumented<Self> ⓘ

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
§

impl<T> WithSubscriber for T

§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self> ⓘ
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a [WithDispatch] wrapper. Read more
§

fn with_current_subscriber(self) -> WithDispatch<Self> ⓘ

Attaches the current default Subscriber to this type, returning a [WithDispatch] wrapper. Read more