pub struct WasmContextSource { /* private fields */ }Expand description
An async context-scope producer over a plugin’s ContextClient. Cheap to
clone (the client is an mpsc Sender clone); every clone talks to the same
actor / Store.
Implementations§
Source§impl WasmContextSource
impl WasmContextSource
Sourcepub fn new(client: ContextClient) -> Self
pub fn new(client: ContextClient) -> Self
Build the adapter over a client bridge. (No connect/spec round-trip
like completion — a context provider has no id/doc metadata; it is a pure
producer keyed by the plugin that owns it.)
Sourcepub async fn context_scopes(
&self,
buffer_id: u64,
path: Option<&Path>,
line_count: u32,
tree: Option<Arc<SyntaxSnapshot>>,
) -> Result<Vec<ContextScope>, String>
pub async fn context_scopes( &self, buffer_id: u64, path: Option<&Path>, line_count: u32, tree: Option<Arc<SyntaxSnapshot>>, ) -> Result<Vec<ContextScope>, String>
Produce the structural context scopes for a buffer — the async producer the host calls OFF the render path when a reparse lands.
Graceful (§8, no blanking): the outer host error (trap / plugin-gone) and
the inner guest WIT err both collapse to the String the caller logs —
on an Err the caller keeps the buffer’s prior cached scopes rather
than clearing them, so a failed refresh never reads as the feature
breaking. A scope that fails to cross fails the whole batch as a typed
error, never a silent drop.
Trait Implementations§
Source§impl AsyncContextSource for WasmContextSource
impl AsyncContextSource for WasmContextSource
Source§fn source_id(&self) -> u64
fn source_id(&self) -> u64
AsyncGutterDecorationSource::source_id.Source§impl Clone for WasmContextSource
impl Clone for WasmContextSource
Source§fn clone(&self) -> WasmContextSource
fn clone(&self) -> WasmContextSource
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreAuto Trait Implementations§
impl !RefUnwindSafe for WasmContextSource
impl !UnwindSafe for WasmContextSource
impl Freeze for WasmContextSource
impl Send for WasmContextSource
impl Sync for WasmContextSource
impl Unpin for WasmContextSource
impl UnsafeUnpin for WasmContextSource
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
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 moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
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