ricecoder_lsp/semantic/
typescript_analyzer.rs1use super::{SemanticAnalyzer, SemanticResult};
6use crate::types::{Language, Position, SemanticInfo, Symbol};
7
8pub struct TypeScriptAnalyzer;
10
11impl TypeScriptAnalyzer {
12 pub fn new() -> Self {
14 Self
15 }
16}
17
18impl Default for TypeScriptAnalyzer {
19 fn default() -> Self {
20 Self::new()
21 }
22}
23
24impl SemanticAnalyzer for TypeScriptAnalyzer {
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::TypeScript
42 }
43}
44
45#[cfg(test)]
46mod tests {
47 use super::*;
48
49 #[test]
50 fn test_language() {
51 let analyzer = TypeScriptAnalyzer::new();
52 assert_eq!(analyzer.language(), Language::TypeScript);
53 }
54}