-
Notifications
You must be signed in to change notification settings - Fork 1.8k
Open
Labels
Description
I would like to ask for textDocument/hover
support for constants defined with const fn
. In my example below, you can see that an add
function works, but not usize.ilog2().
Works as expected
pub const fn add(a: u32, b: u32) -> u32 { a + b }
pub const ADD_EXAMPLE: u32 = add(2, 3);
Hovering over ADD_EXAMPLE
shows 5
as expected...

Feature request
pub const fn ilog2(n: u32) -> u32 { n.ilog2() }
pub const ILOG2_EXAMPLE: u32 = ilog2(16);
But hovering over ILOG2_EXAMPLE
currently shows: ilog2(16)
instead of 4
...

Background
I have an application where I define constants based on usize.ilog2() and I like to sanity check the results in my editor.