pub struct LanguageRegistry { /* private fields */ }
Expand description
Language registry for detection and parsing
Implementations§
Source§impl LanguageRegistry
impl LanguageRegistry
Sourcepub fn detect_language(&self, path: &Path) -> AstResult<Language>
pub fn detect_language(&self, path: &Path) -> AstResult<Language>
Detect language from file path Note: Returns error for config/markup files that should use patch-based editing
Sourcepub fn parse(&self, language: &Language, source: &str) -> AstResult<ParsedAst>
pub fn parse(&self, language: &Language, source: &str) -> AstResult<ParsedAst>
Parse source code for a given language
Sourcepub fn stats(&self) -> LanguageRegistryStats
pub fn stats(&self) -> LanguageRegistryStats
Get statistics about loaded parsers
Trait Implementations§
Source§impl Debug for LanguageRegistry
impl Debug for LanguageRegistry
Auto Trait Implementations§
impl Freeze for LanguageRegistry
impl !RefUnwindSafe for LanguageRegistry
impl Send for LanguageRegistry
impl Sync for LanguageRegistry
impl Unpin for LanguageRegistry
impl UnwindSafe for LanguageRegistry
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