Skip to content

Commit e3b19da

Browse files
committed
Add ok postfix completion
1 parent bcdedbb commit e3b19da

File tree

1 file changed

+12
-0
lines changed

1 file changed

+12
-0
lines changed

crates/ide/src/completion/complete_postfix.rs

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -175,6 +175,16 @@ pub(super) fn complete_postfix(acc: &mut Completions, ctx: &CompletionContext) {
175175
)
176176
.add_to(acc);
177177

178+
postfix_snippet(
179+
ctx,
180+
cap,
181+
&dot_receiver,
182+
"ok",
183+
"Ok(expr)",
184+
&format!("Ok({})", receiver_text),
185+
)
186+
.add_to(acc);
187+
178188
postfix_snippet(
179189
ctx,
180190
cap,
@@ -266,6 +276,7 @@ fn main() {
266276
sn if if expr {}
267277
sn match match expr {}
268278
sn not !expr
279+
sn ok Ok(expr)
269280
sn ref &expr
270281
sn refm &mut expr
271282
sn while while expr {}
@@ -287,6 +298,7 @@ fn main() {
287298
sn call function(expr)
288299
sn dbg dbg!(expr)
289300
sn match match expr {}
301+
sn ok Ok(expr)
290302
sn ref &expr
291303
sn refm &mut expr
292304
"#]],

0 commit comments

Comments
 (0)