mirror of
https://github.com/rust-lang/rust-analyzer.git
synced 2025-10-01 22:31:43 +00:00
Implement dummy expansions for builtin attributes
This commit is contained in:
parent
5f592f4f58
commit
ae8d74ab2c
10 changed files with 176 additions and 11 deletions
|
@ -656,6 +656,32 @@ fn main() { let _ = crate::$0 }
|
|||
);
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn does_not_complete_non_fn_macros() {
|
||||
check(
|
||||
r#"
|
||||
mod m {
|
||||
#[rustc_builtin_macro]
|
||||
pub macro Clone {}
|
||||
}
|
||||
|
||||
fn f() {m::$0}
|
||||
"#,
|
||||
expect![[r#""#]],
|
||||
);
|
||||
check(
|
||||
r#"
|
||||
mod m {
|
||||
#[rustc_builtin_macro]
|
||||
pub macro bench {}
|
||||
}
|
||||
|
||||
fn f() {m::$0}
|
||||
"#,
|
||||
expect![[r#""#]],
|
||||
);
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn completes_in_assoc_item_list() {
|
||||
check(
|
||||
|
|
|
@ -481,14 +481,14 @@ impl S {
|
|||
);
|
||||
check(
|
||||
r#"
|
||||
mod m {
|
||||
#[rustc_builtin_macro]
|
||||
pub macro Clone {}
|
||||
}
|
||||
#[rustc_builtin_macro]
|
||||
pub macro bench {}
|
||||
|
||||
fn f() {m::$0}
|
||||
fn f() {$0}
|
||||
"#,
|
||||
expect![[r#""#]],
|
||||
expect![[r#"
|
||||
fn f() fn()
|
||||
"#]],
|
||||
);
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue