aboutsummaryrefslogtreecommitdiff
path: root/crates/ra_ide/src/diagnostics.rs
diff options
context:
space:
mode:
authorbors[bot] <26634292+bors[bot]@users.noreply.github.com>2020-02-19 17:17:52 +0000
committerGitHub <[email protected]>2020-02-19 17:17:52 +0000
commit889851b52e05f95bf04c6b577a0a63b8e0e523cb (patch)
treebf1cc13ddb0fd6b45e6a19789d5e3cd79caaf904 /crates/ra_ide/src/diagnostics.rs
parent7db7c868812c7289626825988fb6e610ea747eeb (diff)
parent9549aad525845d5e401a71254d25ca92920de462 (diff)
Merge #3241
3241: Fill missing fields of enum variants r=matklad a=matklad bors r+ 🤖 Co-authored-by: Aleksey Kladov <[email protected]>
Diffstat (limited to 'crates/ra_ide/src/diagnostics.rs')
-rw-r--r--crates/ra_ide/src/diagnostics.rs29
1 files changed, 29 insertions, 0 deletions
diff --git a/crates/ra_ide/src/diagnostics.rs b/crates/ra_ide/src/diagnostics.rs
index 82596c665..9cf86b26d 100644
--- a/crates/ra_ide/src/diagnostics.rs
+++ b/crates/ra_ide/src/diagnostics.rs
@@ -470,6 +470,35 @@ mod tests {
470 } 470 }
471 471
472 #[test] 472 #[test]
473 fn test_fill_struct_fields_enum() {
474 let before = r"
475 enum Expr {
476 Bin { lhs: Box<Expr>, rhs: Box<Expr> }
477 }
478
479 impl Expr {
480 fn new_bin(lhs: Box<Expr>, rhs: Box<Expr>) -> Expr {
481 Expr::Bin { <|> }
482 }
483 }
484
485 ";
486 let after = r"
487 enum Expr {
488 Bin { lhs: Box<Expr>, rhs: Box<Expr> }
489 }
490
491 impl Expr {
492 fn new_bin(lhs: Box<Expr>, rhs: Box<Expr>) -> Expr {
493 Expr::Bin { lhs: (), rhs: () <|> }
494 }
495 }
496
497 ";
498 check_apply_diagnostic_fix(before, after);
499 }
500
501 #[test]
473 fn test_fill_struct_fields_partial() { 502 fn test_fill_struct_fields_partial() {
474 let before = r" 503 let before = r"
475 struct TestStruct { 504 struct TestStruct {