mirror of
https://github.com/rust-lang/rust-analyzer.git
synced 2025-09-30 13:51:31 +00:00
Support completion for macros
This commit is contained in:
parent
e2ebb467bd
commit
7de9537ccc
4 changed files with 295 additions and 2 deletions
|
@ -584,6 +584,42 @@ mod tests {
|
|||
kind: Function,
|
||||
detail: "fn foo()",
|
||||
},
|
||||
]"###
|
||||
);
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn completes_quantified_macros() {
|
||||
assert_debug_snapshot!(
|
||||
do_reference_completion(
|
||||
"
|
||||
#[macro_export]
|
||||
macro_rules! foo {
|
||||
() => {}
|
||||
}
|
||||
|
||||
fn main() {
|
||||
let _ = crate::<|>
|
||||
}
|
||||
"
|
||||
),
|
||||
@r###"[
|
||||
CompletionItem {
|
||||
label: "foo",
|
||||
source_range: [179; 179),
|
||||
delete: [179; 179),
|
||||
insert: "foo!",
|
||||
kind: Macro,
|
||||
detail: "#[macro_export]\nmacro_rules! foo",
|
||||
},
|
||||
CompletionItem {
|
||||
label: "main",
|
||||
source_range: [179; 179),
|
||||
delete: [179; 179),
|
||||
insert: "main()$0",
|
||||
kind: Function,
|
||||
detail: "fn main()",
|
||||
},
|
||||
]"###
|
||||
);
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue