Skip to content

Commit cf905cf

Browse files
committed
Put layout comment to the top of hovers
1 parent 659d4f9 commit cf905cf

File tree

2 files changed

+108
-57
lines changed

2 files changed

+108
-57
lines changed

crates/ide/src/hover/render.rs

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -463,9 +463,9 @@ pub(super) fn definition(
463463
};
464464

465465
let label = match (value, layout_info) {
466-
(Some(value), Some(layout_info)) => format!("{label} = {value}{layout_info}"),
466+
(Some(value), Some(layout_info)) => format!("{layout_info}\n{label} = {value}"),
467467
(Some(value), None) => format!("{label} = {value}"),
468-
(None, Some(layout_info)) => format!("{label}{layout_info}"),
468+
(None, Some(layout_info)) => format!("{layout_info}\n{label}"),
469469
(None, None) => label,
470470
};
471471

@@ -617,8 +617,6 @@ fn render_memory_layout(
617617
offset: impl FnOnce(&Layout) -> Option<u64>,
618618
tag: impl FnOnce(&Layout) -> Option<usize>,
619619
) -> Option<String> {
620-
// field
621-
622620
let config = config?;
623621
let layout = layout().ok()?;
624622

0 commit comments

Comments
 (0)