pub struct LanguageSpec {
pub name: String,
pub grammar_name: String,
pub extensions: Vec<String>,
pub grammar: Vec<u8>,
pub highlights: Option<String>,
pub folds: Option<String>,
pub injections: Option<String>,
pub indents: Option<String>,
pub textobjects: Option<String>,
pub conceal_rules: Vec<(String, Vec<u32>, Option<String>)>,
}Expand description
One language a guest declared, ready for the loader to compile and register.
Plain data. The grammar is still bytes here — deliberately, see the module docs.
Fields§
§name: String§grammar_name: StringThe grammar’s tree_sitter_<x> export name. Defaults to name; they
differ when a grammar’s upstream name is not the language’s (lattice’s
own sql rides the sequel grammar).
extensions: Vec<String>Lower-cased, leading dots stripped, blanks dropped.
grammar: Vec<u8>The grammar, compiled to wasm, exactly as the guest supplied it.
highlights: Option<String>§folds: Option<String>§injections: Option<String>§indents: Option<String>§textobjects: Option<String>§conceal_rules: Vec<(String, Vec<u32>, Option<String>)>H.2: (pattern, hide-groups) as declared, uncompiled.
Not compiled here for the same reason the queries are not: this
runs with the guest’s store alive, and compilation belongs in the
loader’s drain beside the grammar. The shape checks that DO run
here are the ones that need no engine — see validate_language.
Trait Implementations§
Source§impl Clone for LanguageSpec
impl Clone for LanguageSpec
Source§fn clone(&self) -> LanguageSpec
fn clone(&self) -> LanguageSpec
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for LanguageSpec
impl Debug for LanguageSpec
impl Eq for LanguageSpec
Source§impl PartialEq for LanguageSpec
impl PartialEq for LanguageSpec
impl StructuralPartialEq for LanguageSpec
Auto Trait Implementations§
impl Freeze for LanguageSpec
impl RefUnwindSafe for LanguageSpec
impl Send for LanguageSpec
impl Sync for LanguageSpec
impl Unpin for LanguageSpec
impl UnsafeUnpin for LanguageSpec
impl UnwindSafe for LanguageSpec
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<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key and return true if they are equal.§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