Skip to content

Commit 55b2559

Browse files
committed
feat: Opens random file to kick off index
1 parent 8843061 commit 55b2559

File tree

1 file changed

+32
-0
lines changed

1 file changed

+32
-0
lines changed

crates/code-agent-sdk/src/config/config_manager.rs

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -82,6 +82,38 @@ impl ConfigManager {
8282
.ok()
8383
.and_then(|c| c.get_server_name_for_language(language))
8484
}
85+
86+
/// Get file extensions for a language
87+
pub fn get_extensions_for_language(&self, language: &str) -> Vec<String> {
88+
self.get_config()
89+
.ok()
90+
.and_then(|c| c.get_config_by_language(language).ok())
91+
.map(|config| config.file_extensions)
92+
.unwrap_or_default()
93+
}
94+
95+
/// Get exclude patterns for a language
96+
pub fn get_exclude_patterns_for_language(&self, language: &str) -> Vec<String> {
97+
self.get_config()
98+
.ok()
99+
.and_then(|c| c.get_config_by_language(language).ok())
100+
.map(|config| config.exclude_patterns)
101+
.unwrap_or_default()
102+
}
103+
104+
/// Get all exclude patterns from all languages (for general file searching)
105+
pub fn get_all_exclude_patterns(&self) -> Vec<String> {
106+
let mut all_patterns = Vec::new();
107+
if let Ok(config) = self.get_config() {
108+
for lang_config in config.all_configs() {
109+
all_patterns.extend(lang_config.exclude_patterns);
110+
}
111+
}
112+
// Remove duplicates
113+
all_patterns.sort();
114+
all_patterns.dedup();
115+
all_patterns
116+
}
85117
}
86118

87119
#[cfg(test)]

0 commit comments

Comments
 (0)