diff options
author | Russell Mull <[email protected]> | 2020-09-22 01:15:20 +0100 |
---|---|---|
committer | Russell Mull <[email protected]> | 2020-09-22 01:15:20 +0100 |
commit | e3b19da8c1e5ba10dffd7a5c381f101c815d46f8 (patch) | |
tree | 422fc22d784aa0dad72631a9eaaa43bb9bde9f2b | |
parent | bcdedbb3d5a45ea974cc5f8e9068e9604c43a757 (diff) |
Add ok postfix completion
-rw-r--r-- | crates/ide/src/completion/complete_postfix.rs | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/crates/ide/src/completion/complete_postfix.rs b/crates/ide/src/completion/complete_postfix.rs index 84c4e129d..c7c3f51a8 100644 --- a/crates/ide/src/completion/complete_postfix.rs +++ b/crates/ide/src/completion/complete_postfix.rs | |||
@@ -179,6 +179,16 @@ pub(super) fn complete_postfix(acc: &mut Completions, ctx: &CompletionContext) { | |||
179 | ctx, | 179 | ctx, |
180 | cap, | 180 | cap, |
181 | &dot_receiver, | 181 | &dot_receiver, |
182 | "ok", | ||
183 | "Ok(expr)", | ||
184 | &format!("Ok({})", receiver_text), | ||
185 | ) | ||
186 | .add_to(acc); | ||
187 | |||
188 | postfix_snippet( | ||
189 | ctx, | ||
190 | cap, | ||
191 | &dot_receiver, | ||
182 | "dbg", | 192 | "dbg", |
183 | "dbg!(expr)", | 193 | "dbg!(expr)", |
184 | &format!("dbg!({})", receiver_text), | 194 | &format!("dbg!({})", receiver_text), |
@@ -266,6 +276,7 @@ fn main() { | |||
266 | sn if if expr {} | 276 | sn if if expr {} |
267 | sn match match expr {} | 277 | sn match match expr {} |
268 | sn not !expr | 278 | sn not !expr |
279 | sn ok Ok(expr) | ||
269 | sn ref &expr | 280 | sn ref &expr |
270 | sn refm &mut expr | 281 | sn refm &mut expr |
271 | sn while while expr {} | 282 | sn while while expr {} |
@@ -287,6 +298,7 @@ fn main() { | |||
287 | sn call function(expr) | 298 | sn call function(expr) |
288 | sn dbg dbg!(expr) | 299 | sn dbg dbg!(expr) |
289 | sn match match expr {} | 300 | sn match match expr {} |
301 | sn ok Ok(expr) | ||
290 | sn ref &expr | 302 | sn ref &expr |
291 | sn refm &mut expr | 303 | sn refm &mut expr |
292 | "#]], | 304 | "#]], |