Skip to content

armgit / zed

Public Imported from GitHub
0

Code at the speed of thought – Zed is a high-performance, multiplayer code editor from the creators of Atom and Tree-sitter.

Add button to view dap logs (#34153)

Julia Ryan2c41e10c9810
diff --git a/crates/debugger_ui/Cargo.toml b/crates/debugger_ui/Cargo.toml
index fc543a47f9b..fe9640b7b9e 100644
--- a/crates/debugger_ui/Cargo.toml
+++ b/crates/debugger_ui/Cargo.toml
@@ -16,13 +16,13 @@ doctest = false
test-support = [
"dap/test-support",
"dap_adapters/test-support",
+ "debugger_tools/test-support",
"editor/test-support",
"gpui/test-support",
"project/test-support",
"util/test-support",
"workspace/test-support",
"unindent",
- "debugger_tools"
]
[dependencies]
@@ -69,7 +69,7 @@ ui.workspace = true
util.workspace = true
workspace.workspace = true
workspace-hack.workspace = true
-debugger_tools = { workspace = true, optional = true }
+debugger_tools.workspace = true
unindent = { workspace = true, optional = true }
zed_actions.workspace = true
diff --git a/crates/debugger_ui/src/debugger_panel.rs b/crates/debugger_ui/src/debugger_panel.rs
index 988f6f4019e..c90a2878e92 100644
--- a/crates/debugger_ui/src/debugger_panel.rs
+++ b/crates/debugger_ui/src/debugger_panel.rs
@@ -622,6 +622,14 @@ impl DebugPanel {
.on_click(move |_, _, cx| cx.open_url("https://zed.dev/docs/debugger"))
.tooltip(Tooltip::text("Open Documentation"))
};
+ let logs_button = || {
+ IconButton::new("debug-open-logs", IconName::ScrollText)
+ .icon_size(IconSize::Small)
+ .on_click(move |_, window, cx| {
+ window.dispatch_action(debugger_tools::OpenDebugAdapterLogs.boxed_clone(), cx)
+ })
+ .tooltip(Tooltip::text("Open Debug Adapter Logs"))
+ };
Some(
div.border_b_1()
@@ -873,6 +881,7 @@ impl DebugPanel {
.justify_around()
.when(is_side, |this| {
this.child(new_session_button())
+ .child(logs_button())
.child(documentation_button())
}),
)
@@ -922,6 +931,7 @@ impl DebugPanel {
))
.when(!is_side, |this| {
this.child(new_session_button())
+ .child(logs_button())
.child(documentation_button())
}),
),