Force rust analyzer to expand macro-rules?

For what ever reason I need to manually "restart" rust-analyzer if I change a single line of code or else it thinks const and static variables no longer exist:

macro_rules! make_types {
    ( $l:ident, ($($n:ident $c:literal $d:expr),*)) => {
        $( pub const $n: &str = $c; )*

        lazy_static! {
            pub static ref $l: Vec<(&'static str, DataType)> = vec![
                $( ($n, $d), )*
            ];
        }
    };
}

it also strangely highlights this use as "unresolved import" until I restart after every code change: use lazy_static::lazy_static;

How can I hint rust-analyzer to expand macros after lines of code change so I don't see as much red in my editor?

Rust-analyzer should always re-expand macros whenever you make a change to the macro definition or the macro invocation. If it doesn't that is a bug.

This topic was automatically closed 90 days after the last reply. We invite you to open a new topic if you have further questions or comments.