debugger: Respect initialize_args from user profiles (#28347)
Closes #ISSUE Release Notes: - N/A Co-authored-by: Ben Kunkle <ben.kunkle@gmail.com>
This commit is contained in:
parent
df94dcdea6
commit
db53da49e1
1 changed files with 4 additions and 3 deletions
|
@ -31,6 +31,7 @@ pub(super) struct NewSessionModal {
|
||||||
debug_panel: WeakEntity<DebugPanel>,
|
debug_panel: WeakEntity<DebugPanel>,
|
||||||
mode: NewSessionMode,
|
mode: NewSessionMode,
|
||||||
stop_on_entry: ToggleState,
|
stop_on_entry: ToggleState,
|
||||||
|
initialize_args: Option<serde_json::Value>,
|
||||||
debugger: Option<SharedString>,
|
debugger: Option<SharedString>,
|
||||||
last_selected_profile_name: Option<SharedString>,
|
last_selected_profile_name: Option<SharedString>,
|
||||||
}
|
}
|
||||||
|
@ -82,17 +83,17 @@ impl NewSessionModal {
|
||||||
.map(Into::into)
|
.map(Into::into)
|
||||||
.unwrap_or(ToggleState::Unselected),
|
.unwrap_or(ToggleState::Unselected),
|
||||||
last_selected_profile_name: None,
|
last_selected_profile_name: None,
|
||||||
|
initialize_args: None,
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
fn debug_config(&self, cx: &App) -> Option<DebugTaskDefinition> {
|
fn debug_config(&self, cx: &App) -> Option<DebugTaskDefinition> {
|
||||||
let request = self.mode.debug_task(cx);
|
let request = self.mode.debug_task(cx);
|
||||||
|
|
||||||
Some(DebugTaskDefinition {
|
Some(DebugTaskDefinition {
|
||||||
adapter: self.debugger.clone()?.to_string(),
|
adapter: self.debugger.clone()?.to_string(),
|
||||||
label: suggested_label(&request, self.debugger.as_deref()?),
|
label: suggested_label(&request, self.debugger.as_deref()?),
|
||||||
request,
|
request,
|
||||||
initialize_args: None,
|
initialize_args: self.initialize_args.clone(),
|
||||||
tcp_connection: None,
|
tcp_connection: None,
|
||||||
locator: None,
|
locator: None,
|
||||||
stop_on_entry: match self.stop_on_entry {
|
stop_on_entry: match self.stop_on_entry {
|
||||||
|
@ -228,7 +229,7 @@ impl NewSessionModal {
|
||||||
weak.update(cx, |this, cx| {
|
weak.update(cx, |this, cx| {
|
||||||
this.last_selected_profile_name = Some(SharedString::from(&task.label));
|
this.last_selected_profile_name = Some(SharedString::from(&task.label));
|
||||||
this.debugger = Some(task.adapter.clone().into());
|
this.debugger = Some(task.adapter.clone().into());
|
||||||
|
this.initialize_args = task.initialize_args.clone();
|
||||||
match &task.request {
|
match &task.request {
|
||||||
DebugRequestType::Launch(launch_config) => {
|
DebugRequestType::Launch(launch_config) => {
|
||||||
this.mode = NewSessionMode::launch(
|
this.mode = NewSessionMode::launch(
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue