refactor: use MetaPlugin.is_supported() to determine plugin status display
Co-authored-by: aider (openai/andrew.openrouter.qwen.qwen3-coder) <aider@aider.chat>
This commit is contained in:
@@ -133,7 +133,10 @@ fn build_meta_plugin_table(enabled_meta_plugins: &Vec<MetaPluginType>) -> Table
|
|||||||
let is_enabled = enabled_meta_plugins.contains(&meta_plugin_type);
|
let is_enabled = enabled_meta_plugins.contains(&meta_plugin_type);
|
||||||
|
|
||||||
// Determine what implementation will actually be used
|
// Determine what implementation will actually be used
|
||||||
let (binary_display, args_display) = match meta_plugin_type {
|
let (binary_display, args_display) = if !is_supported {
|
||||||
|
("<NOT FOUND>".to_string(), "".to_string())
|
||||||
|
} else {
|
||||||
|
match meta_plugin_type {
|
||||||
// For internal plugins, always show as internal
|
// For internal plugins, always show as internal
|
||||||
MetaPluginType::DigestSha256 | MetaPluginType::ReadTime | MetaPluginType::ReadRate |
|
MetaPluginType::DigestSha256 | MetaPluginType::ReadTime | MetaPluginType::ReadRate |
|
||||||
MetaPluginType::Cwd | MetaPluginType::Uid | MetaPluginType::User |
|
MetaPluginType::Cwd | MetaPluginType::Uid | MetaPluginType::User |
|
||||||
@@ -142,10 +145,8 @@ fn build_meta_plugin_table(enabled_meta_plugins: &Vec<MetaPluginType>) -> Table
|
|||||||
MetaPluginType::FullHostname => {
|
MetaPluginType::FullHostname => {
|
||||||
("<INTERNAL>".to_string(), "".to_string())
|
("<INTERNAL>".to_string(), "".to_string())
|
||||||
},
|
},
|
||||||
// For program-based plugins, show program info if supported, otherwise show as not found
|
// For program-based plugins, show program info
|
||||||
_ => {
|
_ => {
|
||||||
// For program-based plugins, we need to check if they're supported
|
|
||||||
if is_supported {
|
|
||||||
// Get the program info by downcasting to MetaPluginProgram
|
// Get the program info by downcasting to MetaPluginProgram
|
||||||
// This is a bit hacky but necessary to get the program info
|
// This is a bit hacky but necessary to get the program info
|
||||||
let program_name = match meta_plugin_type {
|
let program_name = match meta_plugin_type {
|
||||||
@@ -169,8 +170,6 @@ fn build_meta_plugin_table(enabled_meta_plugins: &Vec<MetaPluginType>) -> Table
|
|||||||
};
|
};
|
||||||
|
|
||||||
(program_name, args.to_string())
|
(program_name, args.to_string())
|
||||||
} else {
|
|
||||||
("<NOT FOUND>".to_string(), "".to_string())
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
@@ -187,6 +186,7 @@ fn build_meta_plugin_table(enabled_meta_plugins: &Vec<MetaPluginType>) -> Table
|
|||||||
},
|
},
|
||||||
match binary_display.as_str() {
|
match binary_display.as_str() {
|
||||||
"<INTERNAL>" => Cell::new(&binary_display).with_style(Attr::ForegroundColor(color::BRIGHT_BLACK)),
|
"<INTERNAL>" => Cell::new(&binary_display).with_style(Attr::ForegroundColor(color::BRIGHT_BLACK)),
|
||||||
|
"<NOT FOUND>" => Cell::new(&binary_display).with_style(Attr::ForegroundColor(color::RED)),
|
||||||
_ => Cell::new(&binary_display),
|
_ => Cell::new(&binary_display),
|
||||||
},
|
},
|
||||||
Cell::new(&args_display),
|
Cell::new(&args_display),
|
||||||
|
|||||||
Reference in New Issue
Block a user