Skip to main content

LuaCtx

Struct LuaCtx 

Source
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: Value

Trait Implementations§

Source§

impl Clone for LuaCtx

Source§

fn clone(&self) -> Self

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 Debug for LuaCtx

Source§

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

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

impl Eq for LuaCtx

Source§

impl Language<LuaCtx> for LuaLanguage

Source§

fn supports_symbols(&self) -> bool

Runtime hook for symbol support; defaults to SUPPORTS_SYMBOLS.
Source§

fn engine(&self) -> &Engine<LuaCtx>

The pass schedule run over every document.
Source§

fn root_ctx(&self) -> LuaCtx

Context for a freshly opened document’s root region.
Source§

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 more
Source§

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

Whether to advertise and answer textDocument/documentSymbol. Defaults to false; flip to true and override symbols. Read more
Source§

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>

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

Runtime hook for hover support; defaults to false.
Source§

fn supports_definition(&self) -> bool

Runtime hook for go-to-definition support; defaults to false.
Source§

fn supports_completion(&self) -> bool

Runtime hook for completion support; defaults to false.
Source§

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>

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 hover(&self, doc: &Document<C>, offset: usize) -> Option<Hover>

Hover contents for the byte offset in doc, or None. Read more
Source§

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>

Completions for the byte offset in doc, or None.
Source§

impl PartialEq for LuaCtx

Source§

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

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

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

Inequality operator !=. Read more

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> 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
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

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
Source§

impl<T> MaybeSend for T
where T: Send,

Source§

impl<T> MaybeSync for T
where T: Sync,

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, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = !

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, !>

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.