use async_trait::async_trait;
use thread_services::error::ServiceResult;
use thread_services::traits::{AnalyzerCapabilities, CodeAnalyzer};
use thread_services::types::{AnalysisContext, CrossFileRelationship, ParsedDocument};
pub struct CocoIndexAnalyzer {
}
impl Default for CocoIndexAnalyzer {
fn default() -> Self {
Self::new()
}
}
impl CocoIndexAnalyzer {
pub fn new() -> Self {
Self {}
}
}
#[async_trait]
impl<D: thread_ast_engine::source::Doc + Send + Sync> CodeAnalyzer<D> for CocoIndexAnalyzer {
fn capabilities(&self) -> AnalyzerCapabilities {
AnalyzerCapabilities {
max_concurrent_patterns: Some(50),
max_matches_per_pattern: Some(1000),
supports_pattern_compilation: false,
supports_cross_file_analysis: true,
supports_batch_optimization: true,
supports_incremental_analysis: true,
supported_analysis_depths: vec![], performance_profile: thread_services::traits::AnalysisPerformanceProfile::Balanced,
capability_flags: thread_utilities::get_map(),
}
}
async fn find_pattern(
&self,
_document: &ParsedDocument<D>,
_pattern: &str,
_context: &AnalysisContext,
) -> ServiceResult<Vec<thread_services::types::CodeMatch<'_, D>>> {
Ok(vec![])
}
async fn find_all_patterns(
&self,
_document: &ParsedDocument<D>,
_patterns: &[&str],
_context: &AnalysisContext,
) -> ServiceResult<Vec<thread_services::types::CodeMatch<'_, D>>> {
Ok(vec![])
}
async fn replace_pattern(
&self,
_document: &mut ParsedDocument<D>,
_pattern: &str,
_replacement: &str,
_context: &AnalysisContext,
) -> ServiceResult<usize> {
Ok(0)
}
async fn analyze_cross_file_relationships(
&self,
_documents: &[ParsedDocument<D>],
_context: &AnalysisContext,
) -> ServiceResult<Vec<CrossFileRelationship>> {
Ok(vec![])
}
}