pub struct LexBuiltinsHandler { /* private fields */ }Expand description
Composite handler for the lex.* built-in namespace.
Registry::register_namespace accepts one handler per namespace; the
composite shape lets every lex.* built-in live under a single
namespace registration while keeping per-label logic isolated. The
doc.* family is registered separately with DocBuiltinsHandler
— see register_into.
Implementations across hooks (one per lifecycle phase):
on_resolve: onlyLexIncludeHandler(#532).lex.tabular.*andlex.media.*migrated offon_resolvein #615 — verbatim hydration belongs on the IR-construction lifecycle, not the AST-substitution lifecycle.on_ir_build:lex.tabular.table(verbatim body → typedWireNode::Table) andlex.media.{image,video,audio}(params → typedWireNode::Image|Video|Audio). #615 unified surface.on_format:lex.tabular.tableandlex.media.{image,video,audio}round-trip back to:: lex.<family>.<kind> ::Lex source. (#570 Phase 4b.)
Implementations§
Trait Implementations§
Source§impl LexHandler for LexBuiltinsHandler
impl LexHandler for LexBuiltinsHandler
Source§fn on_format(
&self,
ctx: &FormatCtx,
) -> Result<Option<LexAnnotationOut>, HandlerError>
fn on_format( &self, ctx: &FormatCtx, ) -> Result<Option<LexAnnotationOut>, HandlerError>
Phase 4b of #570: emit the canonical Lex-source shape for the
built-in lex.tabular.* and lex.media.* labels.
The verbatim labels round-trip as :: lex.<family>.<kind> ::
closers with the body text and parameters carried verbatim from
the supplied WireNode::Verbatim. Anything else (e.g.
lex.include, metadata labels, unrecognised labels) returns
Ok(None) so the host falls back to its built-in formatter.
Source§fn on_resolve(&self, ctx: &LabelCtx) -> Result<Option<WireNode>, HandlerError>
fn on_resolve(&self, ctx: &LabelCtx) -> Result<Option<WireNode>, HandlerError>
Ok(None) leaves the original node in place. Read moreSource§fn on_ir_build(&self, ctx: &LabelCtx) -> Result<Option<WireNode>, HandlerError>
fn on_ir_build(&self, ctx: &LabelCtx) -> Result<Option<WireNode>, HandlerError>
from_lex), strictly after parsing and strictly before render.
Ok(None) falls back to the host’s generic verbatim/annotation IR. Read moreSource§fn on_label(&self, _ctx: &LabelCtx)
fn on_label(&self, _ctx: &LabelCtx)
Source§fn on_validate(&self, _ctx: &LabelCtx) -> Result<Vec<Diagnostic>, HandlerError>
fn on_validate(&self, _ctx: &LabelCtx) -> Result<Vec<Diagnostic>, HandlerError>
Source§fn on_render(
&self,
_ctx: &LabelCtx,
_fmt: Format,
) -> Result<Option<RenderOut>, HandlerError>
fn on_render( &self, _ctx: &LabelCtx, _fmt: Format, ) -> Result<Option<RenderOut>, HandlerError>
lexd convert or library-driven rendering. Ok(None) falls
back to default rendering of the underlying node.Source§fn on_hover(&self, _ctx: &LabelCtx) -> Result<Option<Hover>, HandlerError>
fn on_hover(&self, _ctx: &LabelCtx) -> Result<Option<Hover>, HandlerError>
textDocument/hover LSP requests.Source§fn on_completion(
&self,
_ctx: &LabelCtx,
) -> Result<Vec<Completion>, HandlerError>
fn on_completion( &self, _ctx: &LabelCtx, ) -> Result<Vec<Completion>, HandlerError>
textDocument/completion.Source§fn on_code_action(
&self,
_ctx: &LabelCtx,
) -> Result<Vec<CodeAction>, HandlerError>
fn on_code_action( &self, _ctx: &LabelCtx, ) -> Result<Vec<CodeAction>, HandlerError>
textDocument/codeAction.Auto Trait Implementations§
impl Freeze for LexBuiltinsHandler
impl !RefUnwindSafe for LexBuiltinsHandler
impl Send for LexBuiltinsHandler
impl Sync for LexBuiltinsHandler
impl Unpin for LexBuiltinsHandler
impl UnsafeUnpin for LexBuiltinsHandler
impl !UnwindSafe for LexBuiltinsHandler
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> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> 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