vtcode_core/config/
output_styles.rs1use hashbrown::HashMap;
5use serde::{Deserialize, Serialize};
6use std::path::Path;
7
8#[derive(Debug, Clone, Serialize, Deserialize)]
9pub struct OutputStyle {
10 pub name: String,
11 pub content: String,
12 pub config: OutputStyleConfig,
13}
14
15#[derive(Debug, Clone, Serialize, Deserialize)]
16pub struct OutputStyleConfig {
17 pub keep_coding_instructions: bool,
18}
19
20#[derive(Debug, Clone)]
21pub struct OutputStyleManager {
22 styles: HashMap<String, OutputStyle>,
23}
24
25impl Default for OutputStyleManager {
26 fn default() -> Self {
27 Self::new()
28 }
29}
30
31impl OutputStyleManager {
32 pub fn new() -> Self {
33 Self {
34 styles: HashMap::new(),
35 }
36 }
37
38 pub fn load_from_directory(_directory: &Path) -> Result<Self, Box<dyn std::error::Error>> {
39 Ok(Self::new())
40 }
41
42 pub fn get_style(&self, name: &str) -> Option<&OutputStyle> {
43 self.styles.get(name)
44 }
45
46 pub fn list_styles(&self) -> Vec<(String, &OutputStyle)> {
47 self.styles.iter().map(|(k, v)| (k.clone(), v)).collect()
48 }
49}