pub struct GrammarSpec {
pub grammar: Language,
pub conceal_rules: Vec<(String, Vec<u32>, Option<String>)>,
pub highlights: Option<String>,
pub folds: Option<String>,
pub injections: Option<String>,
pub indents: Option<String>,
pub textobjects: Option<String>,
}Expand description
Everything a runtime-registered language supplies beyond its identity.
Query sources are compiled at registration, not first use. A
malformed folds.scm is the plugin author’s error and has to surface
at load with the offending query named — not silently disable folding
three days later, which is indistinguishable from the feature not
existing.
Fields§
§grammar: Language§conceal_rules: Vec<(String, Vec<u32>, Option<String>)>H.2: (pattern, hide-groups) as the guest declared them,
uncompiled. Compiled in [compile_plugin_config], where a
refused rule is dropped and logged rather than failing the
language — see conceal.rs for why that is asymmetric with
query compilation.
highlights: Option<String>§folds: Option<String>§injections: Option<String>§indents: Option<String>§textobjects: Option<String>Trait Implementations§
Source§impl Clone for GrammarSpec
impl Clone for GrammarSpec
Source§fn clone(&self) -> GrammarSpec
fn clone(&self) -> GrammarSpec
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreAuto Trait Implementations§
impl Freeze for GrammarSpec
impl RefUnwindSafe for GrammarSpec
impl Send for GrammarSpec
impl Sync for GrammarSpec
impl Unpin for GrammarSpec
impl UnsafeUnpin for GrammarSpec
impl UnwindSafe for GrammarSpec
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,
§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> ⓘ
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