mirror of
https://github.com/rust-lang/rust-analyzer.git
synced 2025-11-18 19:21:38 +00:00
Prettify AST in PathTransform if it's coming from a macro
This commit is contained in:
parent
317542c1e4
commit
4db8341ddb
3 changed files with 58 additions and 4 deletions
|
|
@ -550,3 +550,30 @@ fn inside_extern_blocks() {
|
|||
"#]],
|
||||
)
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn tokens_from_macro() {
|
||||
check_edit(
|
||||
"fn as_ref",
|
||||
r#"
|
||||
//- proc_macros: identity
|
||||
//- minicore: as_ref
|
||||
struct Foo;
|
||||
|
||||
#[proc_macros::identity]
|
||||
impl<'a> AsRef<&'a i32> for Foo {
|
||||
$0
|
||||
}
|
||||
"#,
|
||||
r#"
|
||||
struct Foo;
|
||||
|
||||
#[proc_macros::identity]
|
||||
impl<'a> AsRef<&'a i32> for Foo {
|
||||
fn as_ref(&self) -> &&'a i32 {
|
||||
$0
|
||||
}
|
||||
}
|
||||
"#,
|
||||
);
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue