extension: Another batch of updates for DAP extension API (#32809)
Closes #ISSUE Release Notes: - N/A
This commit is contained in:
parent
4383fee3c1
commit
0f0ff40c6d
19 changed files with 142 additions and 107 deletions
|
@ -228,26 +228,36 @@ impl PickerDelegate for AttachModalDelegate {
|
|||
}
|
||||
}
|
||||
|
||||
let Some(scenario) = cx.read_global::<DapRegistry, _>(|registry, _| {
|
||||
registry
|
||||
.adapter(&self.definition.adapter)
|
||||
.and_then(|adapter| adapter.config_from_zed_format(self.definition.clone()).ok())
|
||||
let Some(adapter) = cx.read_global::<DapRegistry, _>(|registry, _| {
|
||||
registry.adapter(&self.definition.adapter)
|
||||
}) else {
|
||||
return;
|
||||
};
|
||||
|
||||
let panel = self
|
||||
.workspace
|
||||
.update(cx, |workspace, cx| workspace.panel::<DebugPanel>(cx))
|
||||
.ok()
|
||||
.flatten();
|
||||
if let Some(panel) = panel {
|
||||
panel.update(cx, |panel, cx| {
|
||||
panel.start_session(scenario, Default::default(), None, None, window, cx);
|
||||
});
|
||||
}
|
||||
let workspace = self.workspace.clone();
|
||||
let definition = self.definition.clone();
|
||||
cx.spawn_in(window, async move |this, cx| {
|
||||
let Ok(scenario) = adapter.config_from_zed_format(definition).await else {
|
||||
return;
|
||||
};
|
||||
|
||||
cx.emit(DismissEvent);
|
||||
let panel = workspace
|
||||
.update(cx, |workspace, cx| workspace.panel::<DebugPanel>(cx))
|
||||
.ok()
|
||||
.flatten();
|
||||
if let Some(panel) = panel {
|
||||
panel
|
||||
.update_in(cx, |panel, window, cx| {
|
||||
panel.start_session(scenario, Default::default(), None, None, window, cx);
|
||||
})
|
||||
.ok();
|
||||
}
|
||||
this.update(cx, |_, cx| {
|
||||
cx.emit(DismissEvent);
|
||||
})
|
||||
.ok();
|
||||
})
|
||||
.detach();
|
||||
}
|
||||
|
||||
fn dismissed(&mut self, _window: &mut Window, cx: &mut Context<Picker<Self>>) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue