vtcode_config/defaults/
syntax_highlighting.rs1use super::provider;
2
3const DEFAULT_MAX_FILE_SIZE_MB: usize = 10;
4const DEFAULT_HIGHLIGHT_TIMEOUT_MS: u64 = 5_000;
5const MIN_FILE_SIZE_MB: usize = 1;
6const MIN_HIGHLIGHT_TIMEOUT_MS: u64 = 100;
7
8pub struct SyntaxHighlightingDefaults;
10
11impl SyntaxHighlightingDefaults {
12 pub fn enabled() -> bool {
14 true
15 }
16
17 pub fn cache_themes() -> bool {
19 true
20 }
21
22 pub fn theme() -> String {
24 provider::with_config_defaults(|defaults| defaults.syntax_theme())
25 }
26
27 pub fn max_file_size_mb() -> usize {
29 DEFAULT_MAX_FILE_SIZE_MB
30 }
31
32 pub fn highlight_timeout_ms() -> u64 {
34 DEFAULT_HIGHLIGHT_TIMEOUT_MS
35 }
36
37 pub fn min_highlight_timeout_ms() -> u64 {
39 MIN_HIGHLIGHT_TIMEOUT_MS
40 }
41
42 pub fn min_file_size_mb() -> usize {
44 MIN_FILE_SIZE_MB
45 }
46
47 pub fn enabled_languages() -> Vec<String> {
49 provider::with_config_defaults(|defaults| defaults.syntax_languages())
50 }
51}
52
53pub fn enabled() -> bool {
55 SyntaxHighlightingDefaults::enabled()
56}
57
58pub fn cache_themes() -> bool {
60 SyntaxHighlightingDefaults::cache_themes()
61}
62
63pub fn theme() -> String {
65 SyntaxHighlightingDefaults::theme()
66}
67
68pub fn max_file_size_mb() -> usize {
70 SyntaxHighlightingDefaults::max_file_size_mb()
71}
72
73pub fn highlight_timeout_ms() -> u64 {
75 SyntaxHighlightingDefaults::highlight_timeout_ms()
76}
77
78pub fn enabled_languages() -> Vec<String> {
80 SyntaxHighlightingDefaults::enabled_languages()
81}