diff --git a/Cargo.lock b/Cargo.lock index 53b1c7254ef95e12fed4def4a2c963d8d3b6bd6a..06be4d3db99bac7c68f2e6fad14b1ca3d585b6d0 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -4054,6 +4054,7 @@ dependencies = [ "dap", "futures 0.3.31", "gpui", + "json_dotpath", "language", "paths", "serde", @@ -8550,6 +8551,18 @@ dependencies = [ "wasm-bindgen", ] +[[package]] +name = "json_dotpath" +version = "1.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "dbdcfef3cf5591f0cef62da413ae795e3d1f5a00936ccec0b2071499a32efd1a" +dependencies = [ + "serde", + "serde_derive", + "serde_json", + "thiserror 1.0.69", +] + [[package]] name = "jsonschema" version = "0.30.0" diff --git a/Cargo.toml b/Cargo.toml index bd70e9f9dd68de525983526512beed2308531d9c..8721771cd3c9b34e315a55558b1de0f61eebcd07 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -462,6 +462,7 @@ indoc = "2" inventory = "0.3.19" itertools = "0.14.0" jj-lib = { git = "https://github.com/jj-vcs/jj", rev = "e18eb8e05efaa153fad5ef46576af145bba1807f" } +json_dotpath = "1.1" jsonschema = "0.30.0" jsonwebtoken = "9.3" jupyter-protocol = { git = "https://github.com/ConradIrwin/runtimed", rev = "7130c804216b6914355d15d0b91ea91f6babd734" } diff --git a/crates/dap_adapters/Cargo.toml b/crates/dap_adapters/Cargo.toml index 7aaa9d95293f8b4263eaeac36ba81e21a420b858..9eafb6ef4074262449309199d433617435797dd4 100644 --- a/crates/dap_adapters/Cargo.toml +++ b/crates/dap_adapters/Cargo.toml @@ -26,6 +26,7 @@ async-trait.workspace = true dap.workspace = true futures.workspace = true gpui.workspace = true +json_dotpath.workspace = true language.workspace = true paths.workspace = true serde.workspace = true diff --git a/crates/dap_adapters/src/python.rs b/crates/dap_adapters/src/python.rs index f9112d4137c2192f37f12e73e5073db7660d9804..cb9a37eb29bc7c32fd3220c07a406d0365634c18 100644 --- a/crates/dap_adapters/src/python.rs +++ b/crates/dap_adapters/src/python.rs @@ -5,7 +5,9 @@ use dap::{ adapters::DebugTaskDefinition, }; use gpui::{AsyncApp, SharedString}; +use json_dotpath::DotPaths; use language::LanguageName; +use serde_json::Value; use std::{collections::HashMap, ffi::OsStr, path::PathBuf, sync::OnceLock}; use util::ResultExt; @@ -26,8 +28,16 @@ impl PythonDebugAdapter { ) -> Result { let request = self.validate_config(&task_definition.config)?; + let mut configuration = task_definition.config.clone(); + if let Ok(console) = configuration.dot_get_mut("console") { + // Use built-in Zed terminal if user did not explicitly provide a setting for console. + if console.is_null() { + *console = Value::String("integratedTerminal".into()); + } + } + Ok(StartDebuggingRequestArguments { - configuration: task_definition.config.clone(), + configuration, request, }) }