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:
@@ -140,11 +140,11 @@ fn build_config_table(settings: &config::Settings) -> Table {
|
||||
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(
|
||||
meta_plugin_type,
|
||||
Some(plugin_config.options.clone()),
|
||||
Some(plugin_config.outputs.clone()),
|
||||
None,
|
||||
None,
|
||||
);
|
||||
|
||||
// Add plugin name
|
||||
@@ -153,17 +153,18 @@ fn build_config_table(settings: &config::Settings) -> Table {
|
||||
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());
|
||||
}
|
||||
// Get the actual plugin with user-provided options to see the merged result
|
||||
let actual_plugin = get_meta_plugin(
|
||||
meta_plugin_type,
|
||||
Some(plugin_config.options.clone()),
|
||||
Some(plugin_config.outputs.clone()),
|
||||
);
|
||||
|
||||
// Always add options section
|
||||
let options_str = if all_options.is_empty() {
|
||||
// Show the merged options
|
||||
let options_str = if actual_plugin.options().is_empty() {
|
||||
"{}".to_string()
|
||||
} else {
|
||||
serde_yaml::to_string(&all_options)
|
||||
serde_yaml::to_string(actual_plugin.options())
|
||||
.unwrap_or_else(|_| "Unable to serialize options".to_string())
|
||||
.trim()
|
||||
.to_string()
|
||||
@@ -173,11 +174,11 @@ fn build_config_table(settings: &config::Settings) -> Table {
|
||||
Cell::new(&options_str),
|
||||
]));
|
||||
|
||||
// Always add outputs section
|
||||
let outputs_str = if plugin_config.outputs.is_empty() {
|
||||
// Show the merged outputs
|
||||
let outputs_str = if actual_plugin.outputs().is_empty() {
|
||||
"{}".to_string()
|
||||
} else {
|
||||
serde_yaml::to_string(&plugin_config.outputs)
|
||||
serde_yaml::to_string(actual_plugin.outputs())
|
||||
.unwrap_or_else(|_| "Unable to serialize outputs".to_string())
|
||||
.trim()
|
||||
.to_string()
|
||||
|
||||
Reference in New Issue
Block a user