ricecoder_lsp/semantic/
python_analyzer.rs1use super::{SemanticAnalyzer, SemanticResult};
6use crate::types::{Language, Position, SemanticInfo, Symbol};
7
8pub struct PythonAnalyzer;
10
11impl PythonAnalyzer {
12 pub fn new() -> Self {
14 Self
15 }
16}
17
18impl Default for PythonAnalyzer {
19 fn default() -> Self {
20 Self::new()
21 }
22}
23
24impl SemanticAnalyzer for PythonAnalyzer {
25 fn analyze(&self, _code: &str) -> SemanticResult<SemanticInfo> {
26 Ok(SemanticInfo::new())
28 }
29
30 fn extract_symbols(&self, _code: &str) -> SemanticResult<Vec<Symbol>> {
31 Ok(Vec::new())
33 }
34
35 fn get_hover_info(&self, _code: &str, _position: Position) -> SemanticResult<Option<String>> {
36 Ok(None)
38 }
39
40 fn language(&self) -> Language {
41 Language::Python
42 }
43}
44
45#[cfg(test)]
46mod tests {
47 use super::*;
48
49 #[test]
50 fn test_language() {
51 let analyzer = PythonAnalyzer::new();
52 assert_eq!(analyzer.language(), Language::Python);
53 }
54}