Skip to content

Commit 953843a

Browse files
committed
Add stack frame source origin to tooltip
1 parent 5a52c7e commit 953843a

File tree

1 file changed

+17
-1
lines changed

1 file changed

+17
-1
lines changed

crates/debugger_ui/src/stack_frame_list.rs

+17-1
Original file line numberDiff line numberDiff line change
@@ -317,6 +317,11 @@ impl StackFrameList {
317317
.supports_restart_frame
318318
.unwrap_or_default();
319319

320+
let origin = stack_frame
321+
.source
322+
.to_owned()
323+
.and_then(|source| source.origin);
324+
320325
h_flex()
321326
.rounded_md()
322327
.justify_between()
@@ -325,7 +330,18 @@ impl StackFrameList {
325330
.id(("stack-frame", stack_frame.id))
326331
.tooltip({
327332
let formatted_path = formatted_path.clone();
328-
move |cx| Tooltip::text(formatted_path.clone(), cx)
333+
move |cx| {
334+
cx.new_view(|_| {
335+
let mut tooltip = Tooltip::new(formatted_path.clone());
336+
337+
if let Some(origin) = &origin {
338+
tooltip = tooltip.meta(origin);
339+
}
340+
341+
tooltip
342+
})
343+
.into()
344+
}
329345
})
330346
.p_1()
331347
.when(is_selected_frame, |this| {

0 commit comments

Comments
 (0)