pub trait LanguageParser: Send + Sync {
// Required methods
fn language(&self) -> Language;
fn extensions(&self) -> &[&str];
fn extract_nodes(
&self,
tree: &Tree,
source: &str,
file_path: &str,
) -> Vec<CodeNode>;
}Expand description
Trait for language-specific parsing logic.
Each language needs to implement this to handle its unique AST structure and idioms. The trait provides the Tree-sitter language and the extraction logic.
Required Methods§
Sourcefn extensions(&self) -> &[&str]
fn extensions(&self) -> &[&str]
File extensions this parser handles.