diff options
author | uHOOCCOOHu <[email protected]> | 2019-09-10 06:32:47 +0100 |
---|---|---|
committer | uHOOCCOOHu <[email protected]> | 2019-09-10 06:32:47 +0100 |
commit | 7de9537cccc7a6338bcd9c892a1fdb4a6008dc1a (patch) | |
tree | 8c6a25f27708815935511897071c749ecd6111e3 /crates/ra_ide_api/src/completion/complete_path.rs | |
parent | e2ebb467bdf3ebb7d29260adb95c56594c6db282 (diff) |
Support completion for macros
Diffstat (limited to 'crates/ra_ide_api/src/completion/complete_path.rs')
-rw-r--r-- | crates/ra_ide_api/src/completion/complete_path.rs | 36 |
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..55c78d305 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_quantified_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 | } |