feat: add meta plugins information to config table
Co-authored-by: aider (openai/andrew/openrouter/deepseek/deepseek-chat-v3.1) <aider@aider.chat>
This commit is contained in:
@@ -125,6 +125,66 @@ fn build_config_table(settings: &config::Settings) -> Table {
|
||||
]));
|
||||
}
|
||||
|
||||
// Add meta plugins information
|
||||
if let Some(meta_plugins) = &settings.meta_plugins {
|
||||
config_table.add_empty_row();
|
||||
config_table.add_row(Row::new(vec![
|
||||
Cell::new("Meta Plugins").with_style(Attr::Bold),
|
||||
Cell::new(""),
|
||||
]));
|
||||
|
||||
for plugin_config in meta_plugins {
|
||||
// Create the plugin to get its default options
|
||||
let meta_plugin_type = match MetaPluginType::from_str(&plugin_config.name) {
|
||||
Ok(plugin_type) => plugin_type,
|
||||
Err(_) => continue,
|
||||
};
|
||||
|
||||
// Get the plugin with its default options
|
||||
let default_plugin = get_meta_plugin(
|
||||
meta_plugin_type,
|
||||
None,
|
||||
None,
|
||||
);
|
||||
|
||||
// Add plugin name
|
||||
config_table.add_row(Row::new(vec![
|
||||
Cell::new(&format!(" {}", plugin_config.name)),
|
||||
Cell::new(""),
|
||||
]));
|
||||
|
||||
// Merge default options with user-provided options
|
||||
let mut all_options = default_plugin.options().clone();
|
||||
for (key, value) in &plugin_config.options {
|
||||
all_options.insert(key.clone(), value.clone());
|
||||
}
|
||||
|
||||
// Add options
|
||||
if !all_options.is_empty() {
|
||||
let options_str = serde_yaml::to_string(&all_options)
|
||||
.unwrap_or_else(|_| "Unable to serialize options".to_string())
|
||||
.trim()
|
||||
.to_string();
|
||||
config_table.add_row(Row::new(vec![
|
||||
Cell::new(" Options"),
|
||||
Cell::new(&options_str),
|
||||
]));
|
||||
}
|
||||
|
||||
// Add outputs if they exist
|
||||
if !plugin_config.outputs.is_empty() {
|
||||
let outputs_str = serde_yaml::to_string(&plugin_config.outputs)
|
||||
.unwrap_or_else(|_| "Unable to serialize outputs".to_string())
|
||||
.trim()
|
||||
.to_string();
|
||||
config_table.add_row(Row::new(vec![
|
||||
Cell::new(" Outputs"),
|
||||
Cell::new(&outputs_str),
|
||||
]));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
config_table
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user