Skip to main content

PluginSeam

Enum PluginSeam 

Source
pub enum PluginSeam {
Show 21 variants PickerSource, MultibufferViewSource, CompletionSource, Grammar, Events, Modes, Config, Decorations, Media, Context, Theme, Signs, Keymap, Logging, PluginManager, ErrorParser, Help, Dashboard, ScannedExcerptSource, TransientSource, Language,
}
Expand description

Which extension seam a plugin’s component implements — the WIT world it exports. Each seam is its own world (picker-source, events-plugin, …); a component implements one, and the manifest declares which so the plugin loader (lattice-plugin-loader) knows which spawn_* path to drive. An empty provides list is a lifecycle-only plugin (the base plugin world — init.rs, the no-op fixture), driven through instantiate_plugin + activate rather than a seam actor.

Wire form (manifest provides = [...] + [Display]) is the dashed WIT interface name: picker-source, completion-source, grammar, events, modes, config, decorations, context.

Variants§

§

PickerSource

§

MultibufferViewSource

MV.1 — a plugin-contributed multibuffer VIEW: the guest owns the view’s identity, contents, order and status, and the host owns the buffer and the excerpt machinery. Distinct from ScannedExcerptSource, which supplies rows to a view someone else owns.

§

CompletionSource

§

Grammar

§

Events

§

Modes

§

Config

§

Decorations

§

Media

IM.6: inline media blocks (inline-media.md §7). A producer, like Decorations — the guest names files and lines, the host resolves sizes and builds the virtual rows.

§

Context

TC.2 — the sticky-context producer (context-plugin world). Async, host-cached per parse version; see treesitter-context.md.

§

Theme

TC.4 — theme-element declaration (theme-plugin world). The plugin’s elements land in the SAME registry builtins use.

§

Signs

SG.3a — sign declaration (sign-plugin world). The plugin’s signs land in the SAME registry native producers use, styled through the ordinary theme registry.

§

Keymap

§

Logging

The wasi:logging-shaped guest→host logging import (PO.5, Layer 2). Not a native trait seam — the guest’s own narrative, host-captured into the same tracer as the boundary trace.

§

PluginManager

PM.7 — the require seam (plugin-manager-plugin world). A config guest (the user’s init.rs) declares the plugins it wants; the host records the specs and the loader resolves/builds/loads them off-thread. Deliberately its own seam rather than folded into config: declaring software to install is a strictly larger authority than setting an option, and provides is where that difference is visible to a user reading the manifest.

§

ErrorParser

CM.6 — a compilation-output parser (error-parser-plugin world). Sync, fed one captured line at a time by the compilation reader.

§

Help

CR.3 — plugin-contributed :help pages (help-plugin world). The markdown ships inside the component and crosses once, at load; the topic then lives in the same registry the builtin docs do.

§

Dashboard

CR.4 — plugin-contributed launch-page sections (dashboard-plugin world). Sync, and unlike help the guest stays instantiated: a section is a function of a live DashboardCtx, not data.

§

ScannedExcerptSource

OM.A1 — a plugin-contributed producer of scanned excerpts: rows found by reading many files, globally ordered and grouped (scanned-excerpt-source-plugin world). Async, driven once per file of a project walk. The guest declares the file extensions it wants offered, which is what keeps a filetype out of the host’s walk.

OR.9 renamed this from AgendaSource. Its record — line, end-line, group, label, sort-key — is an excerpt plus an ordering plus a group header, and contains nothing about org, dates or TODOs. The agenda is its first consumer, not its definition; a project-TODO view or a tags view is the same shape and should not have to register as an “agenda source”. Renamed while org was still the only consumer, because a seam name is API and third-party plugins would have bound to it.

§

TransientSource

TR.2b — a plugin-contributed transient menu (transient-source-plugin world). Async and live: id() is called once at load to key the registry entry, build(ctx) per menu open, because a builder’s rows depend on where the user opened it from.

§

Language

LG.3c — a plugin-contributed language (language-plugin world). Data, like help: the grammar bytes and query sources cross once at load and the guest is dropped. The host compiles the grammar (~100 ms) and owns the parse loop forever after, so there is no guest call on any hot path.

Implementations§

Source§

impl PluginSeam

Source

pub fn drain_rank(self) -> u8

Where this seam sits in the loader’s drain order (OM.0). Lower drains first; the loader stable-sorts a plugin’s provides by this before draining, so the order a manifest happens to list its seams in cannot change what registers.

The ordering exists because seams have real registration dependencies, and the one that bites is modes on grammar: a mode-keymap-binding resolves its command against the CommandRegistry at registration, so a mode binding a chord to the plugin’s OWN grammar action needs that action already registered. Drain the other way round and the binding is skipped with a log — the plugin loads “successfully” and the user’s chord silently does nothing.

This used to be the plugin author’s problem. Both bundled multi-seam manifests carried a hand-written comment telling the next author to put grammar before modes, which made a load-bearing invariant depend on prose inside a guest-authored file. Sorting here makes it a property of the seam set instead.

The ranks, and why each is where it is:

rankseamsreason
0config, loggingthe option surface: every value any later seam reads exists after this
1themetheme elements later seams may name — and org derives its per-keyword elements from an OPTION, so it must follow rank 0
2languagea major mode may declare target-language; the language should exist first
3grammarregisters commands into the CommandRegistry
4modeskeymap bindings resolve command names — needs rank 3
5keymapuser-layer bindings, same name resolution
6everything elseproducers and data seams with no registration dependency

Ties keep manifest order (the sort is stable), so an author’s intent is respected everywhere it cannot break anything.

OA.14d split config from theme. They shared rank 0, so org’s register-theme-elements reading org.todo-keywords worked only because org’s provides happened to list config first — a load-bearing invariant living in a guest-authored file again, which is the exact thing this function exists to end. It is also the seam boundary the awaited pre-plugin-loaded fires on: the loader publishes it once every rank-0 seam has drained, so a handler can set an option that rank 1 and up will read.

Source

pub fn as_str(self) -> &'static str

The dashed wire / display name (matches the WIT interface).

Trait Implementations§

Source§

impl Clone for PluginSeam

Source§

fn clone(&self) -> PluginSeam

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Copy for PluginSeam

Source§

impl Debug for PluginSeam

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Display for PluginSeam

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Eq for PluginSeam

Source§

impl FromStr for PluginSeam

Source§

type Err = ()

The associated error which can be returned from parsing.
Source§

fn from_str(s: &str) -> Result<Self, Self::Err>

Parses a string s to return a value of this type. Read more
Source§

impl PartialEq for PluginSeam

Source§

fn eq(&self, other: &PluginSeam) -> bool

Equality operator ==. Read more
1.0.0 (const: unstable) · Source§

fn ne(&self, other: &Rhs) -> bool

Inequality operator !=. Read more
Source§

impl StructuralPartialEq for PluginSeam

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> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
§

impl<Q, K> Equivalent<K> for Q
where Q: Eq + ?Sized, K: Borrow<Q> + ?Sized,

§

fn equivalent(&self, key: &K) -> bool

Compare self to key and return true if they are equal.
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> IntoEither for T

Source§

fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ

Converts self into a Left variant of Either<Self, Self> if into_left is true. Converts self into a Right variant of Either<Self, Self> otherwise. Read more
Source§

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
where F: FnOnce(&Self) -> bool,

Converts self into a Left variant of Either<Self, Self> if into_left(&self) returns true. Converts self into a Right variant of Either<Self, Self> otherwise. Read more
§

impl<T> Pointable for T

§

const ALIGN: usize

The alignment of pointer.
§

type Init = T

The type for initializers.
§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
§

impl<T> Pointee for T

§

type Pointer = u32

§

fn debug( pointer: <T as Pointee>::Pointer, f: &mut Formatter<'_>, ) -> Result<(), Error>

Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T> ToString for T
where T: Display + ?Sized,

Source§

fn to_string(&self) -> String

Converts the given value to a String. Read more
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