fix: implement debug for meta plugin program and remove unused imports
Co-authored-by: aider (openai/andrew/openrouter/qwen/qwen3-coder) <aider@aider.chat>
This commit is contained in:
@@ -7,7 +7,6 @@ use which::which;
|
||||
|
||||
use crate::meta_plugin::MetaPlugin;
|
||||
|
||||
#[derive(Debug)]
|
||||
pub struct MetaPluginProgram {
|
||||
pub program: String,
|
||||
pub args: Vec<String>,
|
||||
@@ -18,6 +17,20 @@ pub struct MetaPluginProgram {
|
||||
writer: Option<Box<dyn Write>>,
|
||||
}
|
||||
|
||||
impl std::fmt::Debug for MetaPluginProgram {
|
||||
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
|
||||
f.debug_struct("MetaPluginProgram")
|
||||
.field("program", &self.program)
|
||||
.field("args", &self.args)
|
||||
.field("supported", &self.supported)
|
||||
.field("meta_name", &self.meta_name)
|
||||
.field("split_whitespace", &self.split_whitespace)
|
||||
.field("process", &self.process)
|
||||
.field("writer", &"Box<dyn Write>")
|
||||
.finish()
|
||||
}
|
||||
}
|
||||
|
||||
impl MetaPluginProgram {
|
||||
pub fn new(program: &str, args: Vec<&str>, meta_name: String, split_whitespace: bool) -> MetaPluginProgram {
|
||||
let program_path = which(program);
|
||||
@@ -77,7 +90,7 @@ impl MetaPlugin for MetaPluginProgram {
|
||||
// Close stdin to signal EOF to the process
|
||||
self.writer.take();
|
||||
|
||||
if let Some(mut process) = self.process.take() {
|
||||
if let Some(process) = self.process.take() {
|
||||
let output = process.wait_with_output()
|
||||
.map_err(|e| io::Error::new(io::ErrorKind::Other, format!("Failed to wait for process: {}", e)))?;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user