context_creator/core/semantic/languages/
cpp.rs1use crate::core::semantic::analyzer::{
4 AnalysisResult, LanguageAnalyzer, SemanticContext, SemanticResult,
5};
6use std::path::Path;
7use tree_sitter::Parser;
8
9#[allow(clippy::new_without_default)]
10pub struct CppAnalyzer {
11 #[allow(dead_code)]
12 parser: Parser,
13}
14
15impl CppAnalyzer {
16 pub fn new() -> Self {
17 let parser = Parser::new();
18 Self { parser }
21 }
22}
23
24impl LanguageAnalyzer for CppAnalyzer {
25 fn language_name(&self) -> &'static str {
26 "Cpp"
27 }
28
29 fn analyze_file(
30 &self,
31 _path: &Path,
32 _content: &str,
33 _context: &SemanticContext,
34 ) -> SemanticResult<AnalysisResult> {
35 Ok(AnalysisResult::default())
37 }
38
39 fn can_handle_extension(&self, extension: &str) -> bool {
40 matches!(extension, "cpp" | "cc" | "cxx" | "hpp" | "h")
41 }
42
43 fn supported_extensions(&self) -> Vec<&'static str> {
44 vec!["cpp", "cc", "cxx", "hpp", "h"]
45 }
46}