Debugger: Add stop on entry support to debug adapter configs (#27942)

This PR adds passing in `stop_on_entry` to debug configs in debug.json
instead of going through initialization args.

This has two benefits:

1. It's more streamlined to a user since every internal adapter supports
`stop_on_entry` for launch requests and Go's adapter supports it for
attach requests too.
2. It will allow @osiewicz `NewSesssionModal` PR to use this field for
the stop on entry checkbox.

Release Notes:

- N/A
This commit is contained in:
Anthony Eid 2025-04-02 13:45:26 -04:00 committed by GitHub
parent e1a8a31fa4
commit 0ba8432b0b
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
14 changed files with 25 additions and 2 deletions

View file

@ -106,6 +106,8 @@ pub struct DebugAdapterConfig {
pub locator: Option<String>,
/// Args to pass to a debug adapter (only used in locator right now)
pub args: Vec<String>,
/// Whether to tell the debug adapter to stop on entry
pub stop_on_entry: Option<bool>,
}
impl From<DebugTaskDefinition> for DebugAdapterConfig {
@ -118,6 +120,7 @@ impl From<DebugTaskDefinition> for DebugAdapterConfig {
tcp_connection: def.tcp_connection,
locator: def.locator,
args: def.args,
stop_on_entry: def.stop_on_entry,
}
}
}
@ -138,6 +141,7 @@ impl TryFrom<DebugAdapterConfig> for DebugTaskDefinition {
tcp_connection: def.tcp_connection,
locator: def.locator,
args: def.args,
stop_on_entry: def.stop_on_entry,
})
}
}
@ -166,6 +170,7 @@ impl DebugTaskDefinition {
initialize_args: self.initialize_args,
locator: self.locator,
tcp_connection: self.tcp_connection,
stop_on_entry: self.stop_on_entry,
});
let label = self.label.clone();
@ -215,6 +220,8 @@ pub struct DebugTaskDefinition {
/// Args to pass to a debug adapter (only used in locator right now)
#[serde(skip)]
pub args: Vec<String>,
/// Whether to tell the debug adapter to stop on entry
pub stop_on_entry: Option<bool>,
}
/// A group of Debug Tasks defined in a JSON file.

View file

@ -144,6 +144,7 @@ impl ResolvedTask {
tcp_connection: debug_args.tcp_connection,
args,
locator: debug_args.locator.clone(),
stop_on_entry: debug_args.stop_on_entry,
})
}
_ => None,

View file

@ -97,6 +97,8 @@ pub struct DebugArgs {
pub initialize_args: Option<serde_json::value::Value>,
/// the locator to use
pub locator: Option<String>,
/// Whether to tell the debug adapter to stop on entry
pub stop_on_entry: Option<bool>,
}
/// Represents the type of task that is being ran