aboutsummaryrefslogtreecommitdiff
path: root/crates/ra_ide_api/src/completion/complete_path.rs
diff options
context:
space:
mode:
Diffstat (limited to 'crates/ra_ide_api/src/completion/complete_path.rs')
-rw-r--r--crates/ra_ide_api/src/completion/complete_path.rs36
1 files changed, 36 insertions, 0 deletions
diff --git a/crates/ra_ide_api/src/completion/complete_path.rs b/crates/ra_ide_api/src/completion/complete_path.rs
index d6b5ac9ad..31e7dffe8 100644
--- a/crates/ra_ide_api/src/completion/complete_path.rs
+++ b/crates/ra_ide_api/src/completion/complete_path.rs
@@ -587,4 +587,40 @@ mod tests {
587]"### 587]"###
588 ); 588 );
589 } 589 }
590
591 #[test]
592 fn completes_qualified_macros() {
593 assert_debug_snapshot!(
594 do_reference_completion(
595 "
596 #[macro_export]
597 macro_rules! foo {
598 () => {}
599 }
600
601 fn main() {
602 let _ = crate::<|>
603 }
604 "
605 ),
606 @r###"[
607 CompletionItem {
608 label: "foo",
609 source_range: [179; 179),
610 delete: [179; 179),
611 insert: "foo!",
612 kind: Macro,
613 detail: "#[macro_export]\nmacro_rules! foo",
614 },
615 CompletionItem {
616 label: "main",
617 source_range: [179; 179),
618 delete: [179; 179),
619 insert: "main()$0",
620 kind: Function,
621 detail: "fn main()",
622 },
623]"###
624 );
625 }
590} 626}