pub struct LanguageEntry { /* private fields */ }Expand description
A single bundled language: its grammar plus its bundled queries.
Implementations§
Source§impl LanguageEntry
impl LanguageEntry
Sourcepub fn name(&self) -> &'static str
pub fn name(&self) -> &'static str
The language identifier, e.g. "rust", "tsx", "markdown_inline".
Sourcepub fn extensions(&self) -> &'static [&'static str]
pub fn extensions(&self) -> &'static [&'static str]
File extensions associated with this language (without the leading dot).
Sourcepub fn highlights_query(&self) -> &'static str
pub fn highlights_query(&self) -> &'static str
The bundled highlights.scm query source (may be empty).
Sourcepub fn injections_query(&self) -> &'static str
pub fn injections_query(&self) -> &'static str
The bundled injections.scm query source (may be empty).
Sourcepub fn locals_query(&self) -> &'static str
pub fn locals_query(&self) -> &'static str
The bundled locals.scm query source (may be empty).
Sourcepub fn highlight_config(
&self,
recognized_names: &[String],
) -> Result<HighlightConfiguration, QueryError>
pub fn highlight_config( &self, recognized_names: &[String], ) -> Result<HighlightConfiguration, QueryError>
Build a ready-to-use HighlightConfiguration from the bundled queries.
recognized_names is the list of capture names your renderer understands
(e.g. ["keyword", "function", "string"]); the configuration is wired so
that Highlight indices map into this slice.
Trait Implementations§
Source§impl Clone for LanguageEntry
impl Clone for LanguageEntry
Source§fn clone(&self) -> LanguageEntry
fn clone(&self) -> LanguageEntry
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 moreimpl Copy for LanguageEntry
Auto Trait Implementations§
impl Freeze for LanguageEntry
impl RefUnwindSafe for LanguageEntry
impl Send for LanguageEntry
impl Sync for LanguageEntry
impl Unpin for LanguageEntry
impl UnsafeUnpin for LanguageEntry
impl UnwindSafe for LanguageEntry
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