fix: Simplify macro statement expansion handling

This commit is contained in:
Lukas Wirth 2022-07-01 14:43:57 +02:00
parent f8c416e1b9
commit 531e152390
10 changed files with 155 additions and 110 deletions

View file

@ -4920,3 +4920,34 @@ impl T for () {
"#]],
);
}
#[test]
fn hover_ranged_macro_call() {
check_hover_range(
r#"
macro_rules! __rust_force_expr {
($e:expr) => {
$e
};
}
macro_rules! vec {
($elem:expr) => {
__rust_force_expr!($elem)
};
}
struct Struct;
impl Struct {
fn foo(self) {}
}
fn f() {
$0vec![Struct]$0;
}
"#,
expect![[r#"
```rust
Struct
```"#]],
);
}