diff options
Diffstat (limited to 'crates/ra_ide_api/src/completion/complete_postfix.rs')
-rw-r--r-- | crates/ra_ide_api/src/completion/complete_postfix.rs | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/crates/ra_ide_api/src/completion/complete_postfix.rs b/crates/ra_ide_api/src/completion/complete_postfix.rs index b5c4d2ebd..af25452b8 100644 --- a/crates/ra_ide_api/src/completion/complete_postfix.rs +++ b/crates/ra_ide_api/src/completion/complete_postfix.rs | |||
@@ -42,6 +42,7 @@ pub(super) fn complete_postfix(acc: &mut Completions, ctx: &CompletionContext) { | |||
42 | ) | 42 | ) |
43 | .add_to(acc); | 43 | .add_to(acc); |
44 | postfix_snippet(ctx, "while", &format!("while {} {{\n$0\n}}", receiver_text)).add_to(acc); | 44 | postfix_snippet(ctx, "while", &format!("while {} {{\n$0\n}}", receiver_text)).add_to(acc); |
45 | postfix_snippet(ctx, "dbg", &format!("dbg!({})", receiver_text)).add_to(acc); | ||
45 | } | 46 | } |
46 | } | 47 | } |
47 | 48 | ||
@@ -92,4 +93,17 @@ mod tests { | |||
92 | "#, | 93 | "#, |
93 | ); | 94 | ); |
94 | } | 95 | } |
96 | |||
97 | #[test] | ||
98 | fn test_filter_postfix_completion4() { | ||
99 | check_snippet_completion( | ||
100 | "filter_postfix_completion4", | ||
101 | r#" | ||
102 | fn main() { | ||
103 | let bar = "a"; | ||
104 | bar.dbg<|> | ||
105 | } | ||
106 | "#, | ||
107 | ); | ||
108 | } | ||
95 | } | 109 | } |