pub struct DocBuiltinsHandler;Expand description
Handler for the doc.* document-level metadata namespace (#615).
Owns the on_render dispatch for the six built-in doc.* canonicals
(doc.title, doc.author, doc.date, doc.tags, doc.category,
doc.template). Per-format text emission lives in
doc::render_doc_annotation; this struct is the
Registry::register_namespace-shaped wrapper.
doc.* doesn’t participate in any other lifecycle phase today —
these labels carry single-line text values consumed verbatim, with
no resolve/IR-build/format hook to declare. If a downstream
register-time consumer wants on_format for doc.* (the IR → Lex
reverse direction), Sub D (#617) will wire that up alongside the
markdown HACK retirement.
Trait Implementations§
Source§impl LexHandler for DocBuiltinsHandler
impl LexHandler for DocBuiltinsHandler
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>
Returns the labelled node’s representation in a target format. Fires
during
lexd convert or library-driven rendering. Ok(None) falls
back to default rendering of the underlying node.Source§fn on_label(&self, _ctx: &LabelCtx)
fn on_label(&self, _ctx: &LabelCtx)
Informational notification fired during the analyse phase. No response
is expected. Use this for handlers that maintain external state
(caches, indices, link graphs).
Source§fn on_validate(&self, _ctx: &LabelCtx) -> Result<Vec<Diagnostic>, HandlerError>
fn on_validate(&self, _ctx: &LabelCtx) -> Result<Vec<Diagnostic>, HandlerError>
Returns diagnostics for a labelled node. Fires during analyse, after
resolve.
Source§fn on_resolve(&self, _ctx: &LabelCtx) -> Result<Option<WireNode>, HandlerError>
fn on_resolve(&self, _ctx: &LabelCtx) -> Result<Option<WireNode>, HandlerError>
Returns an AST replacement subtree, which the host splices into the
parent in place of the labelled node. Fires during the resolve phase,
before analyse.
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>
Returns a typed wire node consumed by the host while building its
in-memory IR from the parsed source. Fires during IR construction
(
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_hover(&self, _ctx: &LabelCtx) -> Result<Option<Hover>, HandlerError>
fn on_hover(&self, _ctx: &LabelCtx) -> Result<Option<Hover>, HandlerError>
Returns hover content for a labelled node. Fires in response to
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>
Returns completion items for a position inside a labelled node’s
params or body. Fires in response to
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>
Returns code actions for a labelled node. Fires in response to
textDocument/codeAction.Source§fn on_format(
&self,
_ctx: &FormatCtx,
) -> Result<Option<LexAnnotationOut>, HandlerError>
fn on_format( &self, _ctx: &FormatCtx, ) -> Result<Option<LexAnnotationOut>, HandlerError>
Returns the Lex-source representation of a typed AST subtree
owned by this handler’s namespace — the inverse of
on_resolve, and the reverse-direction
sibling of on_render for the Lex target
format. Read moreAuto Trait Implementations§
impl Freeze for DocBuiltinsHandler
impl RefUnwindSafe for DocBuiltinsHandler
impl Send for DocBuiltinsHandler
impl Sync for DocBuiltinsHandler
impl Unpin for DocBuiltinsHandler
impl UnsafeUnpin for DocBuiltinsHandler
impl UnwindSafe for DocBuiltinsHandler
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
Mutably borrows from an owned value. Read more
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>
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 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>
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