pub struct LanguageRegistry { /* private fields */ }Implementations§
Source§impl LanguageRegistry
impl LanguageRegistry
Sourcepub fn syntactic_emphasis(&self, file: &mut FileDiff) -> bool
pub fn syntactic_emphasis(&self, file: &mut FileDiff) -> bool
Set char-precise emphasis on file’s diff lines from the AST diff.
Returns false when the syntactic engine is unavailable, so the caller
can fall back to the textual engine.
Source§impl LanguageRegistry
impl LanguageRegistry
Sourcepub fn for_path(&self, path: &str) -> Option<&LangEntry>
pub fn for_path(&self, path: &str) -> Option<&LangEntry>
The entry whose grammar handles path, keyed by file extension.
Sourcepub fn for_token(&self, token: &str) -> Option<&LangEntry>
pub fn for_token(&self, token: &str) -> Option<&LangEntry>
The entry for a markdown fence token (rust, py, c++, …), matched
by grammar name then extension.
Sourcepub fn config_for_injection(
&self,
lang: &str,
) -> Option<&HighlightConfiguration>
pub fn config_for_injection( &self, lang: &str, ) -> Option<&HighlightConfiguration>
Highlight config for a tree-sitter injection language name (the inline
markdown grammar, or a fenced code block’s language). None leaves the
injected region plain.
Sourcepub fn markdown_inline_spans(
&self,
content: &str,
) -> Vec<(Range<usize>, &'static str)>
pub fn markdown_inline_spans( &self, content: &str, ) -> Vec<(Range<usize>, &'static str)>
Inline markdown captures (emphasis, code spans, links) as byte range plus
the recognized highlight name, narrowest span first so a first-match
renderer picks the most specific. The inline grammar parses only the
block grammar’s (inline) node ranges, so block markers stay untouched.
Source§impl LanguageRegistry
impl LanguageRegistry
Sourcepub fn scope_index(&self, path: &str, content: &str) -> ScopeIndex
pub fn scope_index(&self, path: &str, content: &str) -> ScopeIndex
Parse content and index its definition spans for scope lookup. Returns
an empty index when the language is unsupported, has no tags query, the
file is too large, or parsing fails — callers then show no breadcrumb.