feat: display merged plugin options and outputs

Co-authored-by: aider (openai/andrew/openrouter/deepseek/deepseek-chat-v3.1) <aider@aider.chat>
This commit is contained in:
Andrew Phillips
2025-08-27 15:53:03 -03:00
parent 31ed7b1b68
commit a402ef413d

View File

@@ -140,11 +140,11 @@ fn build_config_table(settings: &config::Settings) -> Table {
Err(_) => continue, Err(_) => continue,
}; };
// Get the plugin with its default options and outputs // Get the plugin with no options to see its pure defaults
let default_plugin = get_meta_plugin( let default_plugin = get_meta_plugin(
meta_plugin_type, meta_plugin_type,
Some(plugin_config.options.clone()), None,
Some(plugin_config.outputs.clone()), None,
); );
// Add plugin name // Add plugin name
@@ -153,17 +153,18 @@ fn build_config_table(settings: &config::Settings) -> Table {
Cell::new(""), Cell::new(""),
])); ]));
// Merge default options with user-provided options // Get the actual plugin with user-provided options to see the merged result
let mut all_options = default_plugin.options().clone(); let actual_plugin = get_meta_plugin(
for (key, value) in &plugin_config.options { meta_plugin_type,
all_options.insert(key.clone(), value.clone()); Some(plugin_config.options.clone()),
} Some(plugin_config.outputs.clone()),
);
// Always add options section // Show the merged options
let options_str = if all_options.is_empty() { let options_str = if actual_plugin.options().is_empty() {
"{}".to_string() "{}".to_string()
} else { } else {
serde_yaml::to_string(&all_options) serde_yaml::to_string(actual_plugin.options())
.unwrap_or_else(|_| "Unable to serialize options".to_string()) .unwrap_or_else(|_| "Unable to serialize options".to_string())
.trim() .trim()
.to_string() .to_string()
@@ -173,11 +174,11 @@ fn build_config_table(settings: &config::Settings) -> Table {
Cell::new(&options_str), Cell::new(&options_str),
])); ]));
// Always add outputs section // Show the merged outputs
let outputs_str = if plugin_config.outputs.is_empty() { let outputs_str = if actual_plugin.outputs().is_empty() {
"{}".to_string() "{}".to_string()
} else { } else {
serde_yaml::to_string(&plugin_config.outputs) serde_yaml::to_string(actual_plugin.outputs())
.unwrap_or_else(|_| "Unable to serialize outputs".to_string()) .unwrap_or_else(|_| "Unable to serialize outputs".to_string())
.trim() .trim()
.to_string() .to_string()