debugger beta: Fix gdb/delve JSON data conversion from New Session Modal (#31501)
test that check's that each conversion works properly based on the adapter's config validation function. Co-authored-by: Zed AI \<ai@zed.dev\> Release Notes: - debugger beta: Fix bug where Go/GDB configuration's wouldn't work from NewSessionModal
This commit is contained in:
parent
b7c5540075
commit
b63cea1f17
5 changed files with 134 additions and 44 deletions
|
@ -47,13 +47,6 @@ impl PhpDebugAdapter {
|
|||
})
|
||||
}
|
||||
|
||||
fn validate_config(
|
||||
&self,
|
||||
_: &serde_json::Value,
|
||||
) -> Result<StartDebuggingRequestArgumentsRequest> {
|
||||
Ok(StartDebuggingRequestArgumentsRequest::Launch)
|
||||
}
|
||||
|
||||
async fn get_installed_binary(
|
||||
&self,
|
||||
delegate: &Arc<dyn DapDelegate>,
|
||||
|
@ -101,7 +94,7 @@ impl PhpDebugAdapter {
|
|||
envs: HashMap::default(),
|
||||
request_args: StartDebuggingRequestArguments {
|
||||
configuration: task_definition.config.clone(),
|
||||
request: self.validate_config(&task_definition.config)?,
|
||||
request: <Self as DebugAdapter>::validate_config(self, &task_definition.config)?,
|
||||
},
|
||||
})
|
||||
}
|
||||
|
@ -303,6 +296,13 @@ impl DebugAdapter for PhpDebugAdapter {
|
|||
Some(SharedString::new_static("PHP").into())
|
||||
}
|
||||
|
||||
fn validate_config(
|
||||
&self,
|
||||
_: &serde_json::Value,
|
||||
) -> Result<StartDebuggingRequestArgumentsRequest> {
|
||||
Ok(StartDebuggingRequestArgumentsRequest::Launch)
|
||||
}
|
||||
|
||||
fn config_from_zed_format(&self, zed_scenario: ZedDebugConfig) -> Result<DebugScenario> {
|
||||
let obj = match &zed_scenario.request {
|
||||
dap::DebugRequest::Attach(_) => {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue