feat: add default options to meta plugins status table
Co-authored-by: aider (openai/andrew/openrouter/deepseek/deepseek-chat-v3.1) <aider@aider.chat>
This commit is contained in:
@@ -48,6 +48,12 @@ impl TextMetaPlugin {
|
|||||||
outputs,
|
outputs,
|
||||||
);
|
);
|
||||||
|
|
||||||
|
// Set default text_detect_size option if not provided
|
||||||
|
if !base.options.contains_key("text_detect_size") {
|
||||||
|
base.options.insert("text_detect_size".to_string(),
|
||||||
|
serde_yaml::Value::Number(PIPESIZE.into()));
|
||||||
|
}
|
||||||
|
|
||||||
// Get text_detect_size (previously max_buffer_size)
|
// Get text_detect_size (previously max_buffer_size)
|
||||||
let max_buffer_size = base.options.get("text_detect_size")
|
let max_buffer_size = base.options.get("text_detect_size")
|
||||||
.or_else(|| base.options.get("max_buffer_size")) // Handle backward compatibility
|
.or_else(|| base.options.get("max_buffer_size")) // Handle backward compatibility
|
||||||
|
|||||||
@@ -182,23 +182,24 @@ fn build_meta_plugins_configured_table(settings: &config::Settings) -> Option<Ta
|
|||||||
Some(outputs_converted),
|
Some(outputs_converted),
|
||||||
);
|
);
|
||||||
|
|
||||||
// Show the merged options including defaults set by the plugin
|
// Get the default plugin to see its default options
|
||||||
// Convert options to a YAML string, but handle formatting better
|
let default_plugin = get_meta_plugin(
|
||||||
// Note: actual_plugin.options() is not used here, so we don't need to store it
|
|
||||||
|
|
||||||
// For plugins that set default options programmatically, we need to include them
|
|
||||||
// Let's get the default plugin to see what options it would have
|
|
||||||
let _default_plugin = get_meta_plugin(
|
|
||||||
meta_plugin_type.clone(),
|
meta_plugin_type.clone(),
|
||||||
None,
|
None,
|
||||||
None,
|
None,
|
||||||
);
|
);
|
||||||
|
|
||||||
|
// Merge default options with the configured options
|
||||||
|
let mut all_options = default_plugin.options().clone();
|
||||||
|
for (key, value) in &effective_options {
|
||||||
|
all_options.insert(key.clone(), value.clone());
|
||||||
|
}
|
||||||
|
|
||||||
// Use the effective_options which already includes both defaults and configured options
|
// Convert options to a YAML string
|
||||||
let options_str = if effective_options.is_empty() {
|
let options_str = if all_options.is_empty() {
|
||||||
"{}".to_string()
|
"{}".to_string()
|
||||||
} else {
|
} else {
|
||||||
serde_yaml::to_string(&effective_options)
|
serde_yaml::to_string(&all_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()
|
||||||
|
|||||||
Reference in New Issue
Block a user