pub struct LuaCtx(pub Value);Expand description
A context value from Lua: any Value, compared by deep equality.
Deep equality is what lets the incremental tree reuse regions across
edits: two contexts match only if they are structurally identical
(tables recursively; 1 and 1.0 compare equal; functions and other
opaque values never compare equal — contexts should be data).
Tuple Fields§
§0: ValueTrait Implementations§
impl Eq for LuaCtx
Source§impl Language<LuaCtx> for LuaLanguage
impl Language<LuaCtx> for LuaLanguage
Source§fn supports_symbols(&self) -> bool
fn supports_symbols(&self) -> bool
Runtime hook for symbol support; defaults to
SUPPORTS_SYMBOLS.Source§fn diagnostic(
&self,
doc: &Document<LuaCtx>,
node: FailedNode<'_, LuaCtx>,
) -> Option<Diagnostic>
fn diagnostic( &self, doc: &Document<LuaCtx>, node: FailedNode<'_, LuaCtx>, ) -> Option<Diagnostic>
Renders the diagnostic for a failing region, or
None to stay
silent (e.g. for contexts whose failure is expected). Read moreSource§fn symbols(&self, doc: &Document<LuaCtx>) -> Vec<DocumentSymbol>
fn symbols(&self, doc: &Document<LuaCtx>) -> Vec<DocumentSymbol>
The document symbols for the outline view. Only consulted when
supports_symbols is true.Source§const SUPPORTS_SYMBOLS: bool = false
const SUPPORTS_SYMBOLS: bool = false
Source§fn encoding(&self) -> PositionEncoding
fn encoding(&self) -> PositionEncoding
The position encoding to negotiate with the client.
Defaults to UTF-16, the LSP default and what most clients use.
Source§fn extra_diagnostics(&self, doc: &Document<C>) -> Vec<Diagnostic>
fn extra_diagnostics(&self, doc: &Document<C>) -> Vec<Diagnostic>
Diagnostics that do not come from parse failures — lint-rule
violations, style warnings, anything computed from the settled
document rather than a failing tree node. Merged into the same
publishDiagnostics notification, after the parse diagnostics.Source§fn supports_hover(&self) -> bool
fn supports_hover(&self) -> bool
Runtime hook for hover support; defaults to
false.Source§fn supports_definition(&self) -> bool
fn supports_definition(&self) -> bool
Runtime hook for go-to-definition support; defaults to
false.Source§fn supports_completion(&self) -> bool
fn supports_completion(&self) -> bool
Runtime hook for completion support; defaults to
false.Source§fn supports_code_actions(&self) -> bool
fn supports_code_actions(&self) -> bool
Runtime hook for code-action support (the editor’s quickfix
lightbulb); defaults to
false.Source§fn code_action(&self, doc: &Document<C>, range: Range) -> Vec<CodeAction>
fn code_action(&self, doc: &Document<C>, range: Range) -> Vec<CodeAction>
Code actions for the given range — typically quickfixes for the
diagnostics published there. The skeleton dispatches
textDocument/codeAction when
supports_code_actions is true.Source§fn definition(&self, doc: &Document<C>, offset: usize) -> Option<Vec<Location>>
fn definition(&self, doc: &Document<C>, offset: usize) -> Option<Vec<Location>>
Definition locations for the byte
offset in doc, or None.Source§fn completion(
&self,
doc: &Document<C>,
offset: usize,
) -> Option<CompletionResponse>
fn completion( &self, doc: &Document<C>, offset: usize, ) -> Option<CompletionResponse>
Completions for the byte
offset in doc, or None.Auto Trait Implementations§
impl !Freeze for LuaCtx
impl !RefUnwindSafe for LuaCtx
impl !UnwindSafe for LuaCtx
impl Send for LuaCtx
impl Sync for LuaCtx
impl Unpin for LuaCtx
impl UnsafeUnpin for LuaCtx
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> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
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