aboutsummaryrefslogtreecommitdiff
path: root/crates/ra_ide/src/completion/complete_dot.rs
diff options
context:
space:
mode:
Diffstat (limited to 'crates/ra_ide/src/completion/complete_dot.rs')
-rw-r--r--crates/ra_ide/src/completion/complete_dot.rs37
1 files changed, 37 insertions, 0 deletions
diff --git a/crates/ra_ide/src/completion/complete_dot.rs b/crates/ra_ide/src/completion/complete_dot.rs
index f07611d88..a30d1c2de 100644
--- a/crates/ra_ide/src/completion/complete_dot.rs
+++ b/crates/ra_ide/src/completion/complete_dot.rs
@@ -752,6 +752,43 @@ mod tests {
752 } 752 }
753 753
754 #[test] 754 #[test]
755 fn macro_expansion_resilient() {
756 assert_debug_snapshot!(
757 do_ref_completion(
758 r"
759 macro_rules! dbg {
760 () => {};
761 ($val:expr) => {
762 match $val { tmp => { tmp } }
763 };
764 // Trailing comma with single argument is ignored
765 ($val:expr,) => { $crate::dbg!($val) };
766 ($($val:expr),+ $(,)?) => {
767 ($($crate::dbg!($val)),+,)
768 };
769 }
770 struct A { the_field: u32 }
771 fn foo(a: A) {
772 dbg!(a.<|>)
773 }
774 ",
775 ),
776 @r###"
777 [
778 CompletionItem {
779 label: "the_field",
780 source_range: [552; 553),
781 delete: [552; 553),
782 insert: "the_field",
783 kind: Field,
784 detail: "u32",
785 },
786 ]
787 "###
788 );
789 }
790
791 #[test]
755 fn test_method_completion_3547() { 792 fn test_method_completion_3547() {
756 assert_debug_snapshot!( 793 assert_debug_snapshot!(
757 do_ref_completion( 794 do_ref_completion(