Skip to content

Commit

Permalink
Put layout comment to the top of hovers
Browse files Browse the repository at this point in the history
  • Loading branch information
Veykril committed Jan 16, 2024
1 parent 659d4f9 commit cf905cf
Show file tree
Hide file tree
Showing 2 changed files with 108 additions and 57 deletions.
6 changes: 2 additions & 4 deletions crates/ide/src/hover/render.rs
Original file line number Diff line number Diff line change
Expand Up @@ -463,9 +463,9 @@ pub(super) fn definition(
};

let label = match (value, layout_info) {
(Some(value), Some(layout_info)) => format!("{label} = {value}{layout_info}"),
(Some(value), Some(layout_info)) => format!("{layout_info}\n{label} = {value}"),
(Some(value), None) => format!("{label} = {value}"),
(None, Some(layout_info)) => format!("{label}{layout_info}"),
(None, Some(layout_info)) => format!("{layout_info}\n{label}"),
(None, None) => label,
};

Expand Down Expand Up @@ -617,8 +617,6 @@ fn render_memory_layout(
offset: impl FnOnce(&Layout) -> Option<u64>,
tag: impl FnOnce(&Layout) -> Option<usize>,
) -> Option<String> {
// field

let config = config?;
let layout = layout().ok()?;

Expand Down
Loading

0 comments on commit cf905cf

Please sign in to comment.