debugger: Fix the JavaScript debug terminal scenario (#33924)
There were a couple of things preventing this from working: - our hack to stop the node REPL from appearing broke in recent versions of the JS DAP that started passing `--experimental-network-inspection` by default - we had lost the ability to create a debug terminal without specifying a program This PR fixes those issues. We also fixed environment variables from the **runInTerminal** request not getting passed to the spawned program. Release Notes: - Debugger: Fix RunInTerminal not working for JavaScript debugger. --------- Co-authored-by: Cole Miller <cole@zed.dev>
This commit is contained in:
parent
66e45818af
commit
01295aa687
14 changed files with 108 additions and 73 deletions
|
@ -999,7 +999,7 @@ impl Extension {
|
|||
) -> Result<Result<DebugRequest, String>> {
|
||||
match self {
|
||||
Extension::V0_6_0(ext) => {
|
||||
let build_config_template = resolved_build_task.into();
|
||||
let build_config_template = resolved_build_task.try_into()?;
|
||||
let dap_request = ext
|
||||
.call_run_dap_locator(store, &locator_name, &build_config_template)
|
||||
.await?
|
||||
|
|
|
@ -299,15 +299,17 @@ impl From<extension::DebugScenario> for DebugScenario {
|
|||
}
|
||||
}
|
||||
|
||||
impl From<SpawnInTerminal> for ResolvedTask {
|
||||
fn from(value: SpawnInTerminal) -> Self {
|
||||
Self {
|
||||
impl TryFrom<SpawnInTerminal> for ResolvedTask {
|
||||
type Error = anyhow::Error;
|
||||
|
||||
fn try_from(value: SpawnInTerminal) -> Result<Self, Self::Error> {
|
||||
Ok(Self {
|
||||
label: value.label,
|
||||
command: value.command,
|
||||
command: value.command.context("missing command")?,
|
||||
args: value.args,
|
||||
env: value.env.into_iter().collect(),
|
||||
cwd: value.cwd.map(|s| s.to_string_lossy().into_owned()),
|
||||
}
|
||||
})
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue