debugger: Mark DebugAdapterBinary::program as optional (#32534)
This allows us to support debugging with a debug adapter not managed by Zed. Note that this is not a user facing change, as DebugAdapterBinary is used to determine how to spawn a debugger. Thus, this should not break any configs or anything like that. Closes #ISSUE Release Notes: - N/A
This commit is contained in:
parent
a3cc063107
commit
6c4728f00f
14 changed files with 80 additions and 53 deletions
|
@ -359,7 +359,7 @@ impl DebugAdapter for CodeLldbDebugAdapter {
|
|||
};
|
||||
|
||||
Ok(DebugAdapterBinary {
|
||||
command: command.unwrap(),
|
||||
command: Some(command.unwrap()),
|
||||
cwd: Some(delegate.worktree_root_path().to_path_buf()),
|
||||
arguments: vec![
|
||||
"--settings".into(),
|
||||
|
|
|
@ -183,7 +183,7 @@ impl DebugAdapter for GdbDebugAdapter {
|
|||
};
|
||||
|
||||
Ok(DebugAdapterBinary {
|
||||
command: gdb_path,
|
||||
command: Some(gdb_path),
|
||||
arguments: vec!["-i=dap".into()],
|
||||
envs: HashMap::default(),
|
||||
cwd: Some(delegate.worktree_root_path().to_path_buf()),
|
||||
|
|
|
@ -463,7 +463,7 @@ impl DebugAdapter for GoDebugAdapter {
|
|||
};
|
||||
|
||||
Ok(DebugAdapterBinary {
|
||||
command: minidelve_path.to_string_lossy().into_owned(),
|
||||
command: Some(minidelve_path.to_string_lossy().into_owned()),
|
||||
arguments,
|
||||
cwd: Some(cwd),
|
||||
envs: HashMap::default(),
|
||||
|
|
|
@ -69,12 +69,14 @@ impl JsDebugAdapter {
|
|||
let (host, port, timeout) = crate::configure_tcp_connection(tcp_connection).await?;
|
||||
|
||||
Ok(DebugAdapterBinary {
|
||||
command: delegate
|
||||
.node_runtime()
|
||||
.binary_path()
|
||||
.await?
|
||||
.to_string_lossy()
|
||||
.into_owned(),
|
||||
command: Some(
|
||||
delegate
|
||||
.node_runtime()
|
||||
.binary_path()
|
||||
.await?
|
||||
.to_string_lossy()
|
||||
.into_owned(),
|
||||
),
|
||||
arguments: vec![
|
||||
adapter_path
|
||||
.join(Self::ADAPTER_PATH)
|
||||
|
|
|
@ -72,12 +72,14 @@ impl PhpDebugAdapter {
|
|||
let (host, port, timeout) = crate::configure_tcp_connection(tcp_connection).await?;
|
||||
|
||||
Ok(DebugAdapterBinary {
|
||||
command: delegate
|
||||
.node_runtime()
|
||||
.binary_path()
|
||||
.await?
|
||||
.to_string_lossy()
|
||||
.into_owned(),
|
||||
command: Some(
|
||||
delegate
|
||||
.node_runtime()
|
||||
.binary_path()
|
||||
.await?
|
||||
.to_string_lossy()
|
||||
.into_owned(),
|
||||
),
|
||||
arguments: vec![
|
||||
adapter_path
|
||||
.join(Self::ADAPTER_PATH)
|
||||
|
|
|
@ -187,7 +187,7 @@ impl PythonDebugAdapter {
|
|||
);
|
||||
|
||||
Ok(DebugAdapterBinary {
|
||||
command: python_command,
|
||||
command: Some(python_command),
|
||||
arguments,
|
||||
connection: Some(adapters::TcpArguments {
|
||||
host,
|
||||
|
|
|
@ -175,7 +175,7 @@ impl DebugAdapter for RubyDebugAdapter {
|
|||
arguments.extend(ruby_config.args);
|
||||
|
||||
Ok(DebugAdapterBinary {
|
||||
command: rdbg_path.to_string_lossy().to_string(),
|
||||
command: Some(rdbg_path.to_string_lossy().to_string()),
|
||||
arguments,
|
||||
connection: Some(dap::adapters::TcpArguments {
|
||||
host,
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue