diff options
author | Lukas Wirth <[email protected]> | 2021-03-03 20:59:41 +0000 |
---|---|---|
committer | Lukas Wirth <[email protected]> | 2021-03-03 22:04:11 +0000 |
commit | 02e9440e2332beab2647bf61491c788ab84aa4df (patch) | |
tree | a5f4e9e1b30beed2f7ce1fdb59b0b66f3ce3a189 /crates/ide_completion/src/completions/keyword.rs | |
parent | 1914b7723f2f77a7259c65c888107e95f00d0ba1 (diff) |
Complete `while let`
Diffstat (limited to 'crates/ide_completion/src/completions/keyword.rs')
-rw-r--r-- | crates/ide_completion/src/completions/keyword.rs | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/crates/ide_completion/src/completions/keyword.rs b/crates/ide_completion/src/completions/keyword.rs index 17bd19522..03c6dd454 100644 --- a/crates/ide_completion/src/completions/keyword.rs +++ b/crates/ide_completion/src/completions/keyword.rs | |||
@@ -91,6 +91,7 @@ pub(crate) fn complete_expr_keyword(acc: &mut Completions, ctx: &CompletionConte | |||
91 | if ctx.is_expr { | 91 | if ctx.is_expr { |
92 | add_keyword(ctx, acc, "match", "match $0 {}"); | 92 | add_keyword(ctx, acc, "match", "match $0 {}"); |
93 | add_keyword(ctx, acc, "while", "while $0 {}"); | 93 | add_keyword(ctx, acc, "while", "while $0 {}"); |
94 | add_keyword(ctx, acc, "while let", "while let $1 = $0 {}"); | ||
94 | add_keyword(ctx, acc, "loop", "loop {$0}"); | 95 | add_keyword(ctx, acc, "loop", "loop {$0}"); |
95 | add_keyword(ctx, acc, "if", "if $0 {}"); | 96 | add_keyword(ctx, acc, "if", "if $0 {}"); |
96 | add_keyword(ctx, acc, "if let", "if let $1 = $0 {}"); | 97 | add_keyword(ctx, acc, "if let", "if let $1 = $0 {}"); |
@@ -269,6 +270,7 @@ mod tests { | |||
269 | kw trait | 270 | kw trait |
270 | kw match | 271 | kw match |
271 | kw while | 272 | kw while |
273 | kw while let | ||
272 | kw loop | 274 | kw loop |
273 | kw if | 275 | kw if |
274 | kw if let | 276 | kw if let |
@@ -296,6 +298,7 @@ mod tests { | |||
296 | kw trait | 298 | kw trait |
297 | kw match | 299 | kw match |
298 | kw while | 300 | kw while |
301 | kw while let | ||
299 | kw loop | 302 | kw loop |
300 | kw if | 303 | kw if |
301 | kw if let | 304 | kw if let |
@@ -323,6 +326,7 @@ mod tests { | |||
323 | kw trait | 326 | kw trait |
324 | kw match | 327 | kw match |
325 | kw while | 328 | kw while |
329 | kw while let | ||
326 | kw loop | 330 | kw loop |
327 | kw if | 331 | kw if |
328 | kw if let | 332 | kw if let |
@@ -357,6 +361,7 @@ fn quux() -> i32 { | |||
357 | expect![[r#" | 361 | expect![[r#" |
358 | kw match | 362 | kw match |
359 | kw while | 363 | kw while |
364 | kw while let | ||
360 | kw loop | 365 | kw loop |
361 | kw if | 366 | kw if |
362 | kw if let | 367 | kw if let |
@@ -406,6 +411,7 @@ fn quux() -> i32 { | |||
406 | kw trait | 411 | kw trait |
407 | kw match | 412 | kw match |
408 | kw while | 413 | kw while |
414 | kw while let | ||
409 | kw loop | 415 | kw loop |
410 | kw if | 416 | kw if |
411 | kw if let | 417 | kw if let |
@@ -565,6 +571,7 @@ pub mod future { | |||
565 | expect![[r#" | 571 | expect![[r#" |
566 | kw match | 572 | kw match |
567 | kw while | 573 | kw while |
574 | kw while let | ||
568 | kw loop | 575 | kw loop |
569 | kw if | 576 | kw if |
570 | kw if let | 577 | kw if let |
@@ -624,6 +631,7 @@ fn foo() { | |||
624 | expect![[r#" | 631 | expect![[r#" |
625 | kw match | 632 | kw match |
626 | kw while | 633 | kw while |
634 | kw while let | ||
627 | kw loop | 635 | kw loop |
628 | kw if | 636 | kw if |
629 | kw if let | 637 | kw if let |