pub trait LanguageExtractor: Send + Sync {
// Required methods
fn language(&self) -> Language;
fn name(&self) -> &'static str;
fn extensions(&self) -> &'static [&'static str];
fn extract_symbols(
&self,
tree: &Tree,
source: &str,
) -> Result<Vec<ExtractedSymbol>>;
fn extract_imports(&self, tree: &Tree, source: &str) -> Result<Vec<Import>>;
fn extract_calls(
&self,
tree: &Tree,
source: &str,
current_function: Option<&str>,
) -> Result<Vec<FunctionCall>>;
fn extract_doc_comment(
&self,
node: &Node<'_>,
source: &str,
) -> Option<String>;
}Expand description
Trait for language-specific symbol extraction
Required Methods§
Sourcefn extensions(&self) -> &'static [&'static str]
fn extensions(&self) -> &'static [&'static str]
Get file extensions for this language
Sourcefn extract_symbols(
&self,
tree: &Tree,
source: &str,
) -> Result<Vec<ExtractedSymbol>>
fn extract_symbols( &self, tree: &Tree, source: &str, ) -> Result<Vec<ExtractedSymbol>>
Extract symbols from a parsed AST
Sourcefn extract_imports(&self, tree: &Tree, source: &str) -> Result<Vec<Import>>
fn extract_imports(&self, tree: &Tree, source: &str) -> Result<Vec<Import>>
Extract import statements from a parsed AST
Sourcefn extract_calls(
&self,
tree: &Tree,
source: &str,
current_function: Option<&str>,
) -> Result<Vec<FunctionCall>>
fn extract_calls( &self, tree: &Tree, source: &str, current_function: Option<&str>, ) -> Result<Vec<FunctionCall>>
Extract function calls from a parsed AST