dk_engine/parser/langs/
java.rs1use crate::parser::lang_config::{CommentStyle, LanguageConfig};
4use dk_core::Visibility;
5use tree_sitter::Language;
6
7pub struct JavaConfig;
9
10impl LanguageConfig for JavaConfig {
11 fn language(&self) -> Language {
12 tree_sitter_java::LANGUAGE.into()
13 }
14
15 fn extensions(&self) -> &'static [&'static str] {
16 &["java"]
17 }
18
19 fn symbols_query(&self) -> &'static str {
20 include_str!("../queries/java_symbols.scm")
21 }
22
23 fn calls_query(&self) -> &'static str {
24 include_str!("../queries/java_calls.scm")
25 }
26
27 fn imports_query(&self) -> &'static str {
28 include_str!("../queries/java_imports.scm")
29 }
30
31 fn comment_style(&self) -> CommentStyle {
32 CommentStyle::SlashSlash
33 }
34
35 fn resolve_visibility(&self, modifiers: Option<&str>, _name: &str) -> Visibility {
36 match modifiers {
37 Some(m) if m.contains("public") => Visibility::Public,
38 Some(m) if m.contains("protected") => Visibility::Public,
39 _ => Visibility::Private,
41 }
42 }
43
44 fn is_external_import(&self, _module_path: &str) -> bool {
45 true
48 }
49}