mirror of
https://github.com/rust-lang/rust-analyzer.git
synced 2025-09-27 12:29:21 +00:00
Fix prettify_macro_expansion()
when the node isn't the whole file
This commit is contained in:
parent
5982d9c420
commit
c8540e7079
2 changed files with 34 additions and 1 deletions
|
@ -8988,3 +8988,33 @@ mod m {
|
|||
"#]],
|
||||
);
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn regression_18238() {
|
||||
check(
|
||||
r#"
|
||||
macro_rules! foo {
|
||||
($name:ident) => {
|
||||
pub static $name = Foo::new(|| {
|
||||
$crate;
|
||||
});
|
||||
};
|
||||
}
|
||||
|
||||
foo!(BAR_$0);
|
||||
"#,
|
||||
expect![[r#"
|
||||
*BAR_*
|
||||
|
||||
```rust
|
||||
test
|
||||
```
|
||||
|
||||
```rust
|
||||
pub static BAR_: {error} = Foo::new(||{
|
||||
crate;
|
||||
})
|
||||
```
|
||||
"#]],
|
||||
);
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue