debugger: Use integrated terminal for Python (#31190)
Closes #ISSUE Release Notes: - debugger: Use integrated terminal for Python, allowing one to interact with standard input/output when debugging Python projects.
This commit is contained in:
parent
8ab664a52c
commit
3c03d53e3e
4 changed files with 26 additions and 1 deletions
|
@ -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
|
||||
|
|
|
@ -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<StartDebuggingRequestArguments> {
|
||||
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,
|
||||
})
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue