mirror of
https://github.com/rust-lang/rust-analyzer.git
synced 2025-10-01 06:11:35 +00:00
feat: Make unqualified derive attributes flyimportable
This commit is contained in:
parent
7fdbdc4ab2
commit
ebd63ec1cf
11 changed files with 124 additions and 31 deletions
|
@ -640,6 +640,45 @@ mod derive {
|
|||
"#]],
|
||||
)
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn derive_flyimport() {
|
||||
check_derive(
|
||||
r#"
|
||||
//- proc_macros: derive_identity
|
||||
#[derive(der$0)] struct Test;
|
||||
"#,
|
||||
expect![[r#"
|
||||
at DeriveIdentity (use proc_macros::DeriveIdentity)
|
||||
"#]],
|
||||
);
|
||||
check_derive(
|
||||
r#"
|
||||
//- proc_macros: derive_identity
|
||||
use proc_macros::DeriveIdentity;
|
||||
#[derive(der$0)] struct Test;
|
||||
"#,
|
||||
expect![[r#"
|
||||
at DeriveIdentity
|
||||
"#]],
|
||||
);
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn derive_flyimport_edit() {
|
||||
check_edit(
|
||||
"DeriveIdentity",
|
||||
r#"
|
||||
//- proc_macros: derive_identity
|
||||
#[derive(der$0)] struct Test;
|
||||
"#,
|
||||
r#"
|
||||
use proc_macros::DeriveIdentity;
|
||||
|
||||
#[derive(DeriveIdentity)] struct Test;
|
||||
"#,
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
mod lint {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue