context_creator/core/semantic/languages/
elm.rs

1//! Semantic analyzer for Elm
2
3use 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 ElmAnalyzer {
11    #[allow(dead_code)]
12    #[allow(dead_code)]
13    parser: Parser,
14}
15
16impl ElmAnalyzer {
17    pub fn new() -> Self {
18        let parser = Parser::new();
19        // Note: tree_sitter_elm::language() would be used here when the crate is added
20        // parser.set_language(tree_sitter_elm::language()).unwrap();
21        Self { parser }
22    }
23}
24
25impl LanguageAnalyzer for ElmAnalyzer {
26    fn language_name(&self) -> &'static str {
27        "Elm"
28    }
29
30    fn analyze_file(
31        &self,
32        _path: &Path,
33        _content: &str,
34        _context: &SemanticContext,
35    ) -> SemanticResult<AnalysisResult> {
36        // TODO: Implement Elm analysis
37        Ok(AnalysisResult::default())
38    }
39
40    fn can_handle_extension(&self, extension: &str) -> bool {
41        matches!(extension, "elm")
42    }
43
44    fn supported_extensions(&self) -> Vec<&'static str> {
45        vec!["elm"]
46    }
47}