use crate::types::{
ExportStatement, FileAnalysis, FunctionCall, FunctionSignature, ImportStatement,
PartialAnalysis, Result, StructSignature,
};
use async_trait::async_trait;
use tree_sitter::Tree;
#[async_trait]
pub trait LanguageAnalyzer: Send + Sync {
fn language(&self) -> &'static str;
fn file_extensions(&self) -> &[&'static str];
fn supports_async(&self) -> bool;
async fn analyze_file(&self, content: &str, file_path: &str) -> Result<FileAnalysis>;
fn extract_functions(
&self,
tree: &Tree,
source: &str,
file_path: &str,
) -> Result<Vec<FunctionSignature>>;
fn extract_structs(
&self,
tree: &Tree,
source: &str,
file_path: &str,
) -> Result<Vec<StructSignature>>;
fn extract_imports(
&self,
tree: &Tree,
source: &str,
file_path: &str,
) -> Result<Vec<ImportStatement>>;
fn extract_exports(
&self,
tree: &Tree,
source: &str,
file_path: &str,
) -> Result<Vec<ExportStatement>>;
fn extract_function_calls(
&self,
tree: &Tree,
source: &str,
file_path: &str,
) -> Result<Vec<FunctionCall>>;
fn extract_with_fallback(&self, content: &str, file_path: &str) -> PartialAnalysis;
}