Skip to main content

SourceRegistration

Struct SourceRegistration 

Source
pub struct SourceRegistration {
    pub spec: SourceSpec,
    pub kind: CandidateSourceKind,
    pub accept: Option<Arc<dyn AcceptHandler>>,
    pub matcher_override: Option<MatcherId>,
    pub ranker_overrides: Vec<RankerId>,
    pub annotator_extras: Vec<AnnotatorId>,
}
Expand description

The substrate: bundle of every input the pipeline needs to produce + dispatch a source’s candidates.

Lives in lattice-completion (the abstraction layer); the host (lattice-host) holds the per-app CompletionRegistry and stores registrations there. Both surfaces — picker and cmdline-completion — consume registrations through the registry.

Two lifecycles (cross-check § “Two registration lifecycles”):

  • Persistent: registered at boot via CompletionRegistry::register_source, lives until shutdown. First-party Files / Buffers / Commands etc. Plugin sources whose data is synchronously enumerable.

  • Transient: constructed per-use by the host (LSP pickers building from async responses) or a plugin (async- fetch), passed directly to Picker::open_with(reg), dropped after accept/dismiss. Same shape; just shorter lifetime.

Fields§

§spec: SourceSpec§kind: CandidateSourceKind§accept: Option<Arc<dyn AcceptHandler>>

Accept handler. None ⇒ candidate selection is effectively a no-op (rare; cmdline-completion sources today don’t carry an explicit handler — the accept logic is inline. Slice 7c migrates those to explicit handlers returning AcceptAction::InsertText).

§matcher_override: Option<MatcherId>

Per-source matcher override. None ⇒ use the registry default.

§ranker_overrides: Vec<RankerId>

Per-source ranker chain override. Empty ⇒ use the registry default chain.

§annotator_extras: Vec<AnnotatorId>

Additional annotators to run on this source’s candidates, in registration order. Appended to (not replacing) the registry default annotators.

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