From 8c8d0bb34f5495e0f260b5aaf3685ecb98406f32 Mon Sep 17 00:00:00 2001 From: Matthew Jasper Date: Sun, 9 Feb 2020 18:57:01 +0000 Subject: Add or- and parenthesized-patterns --- crates/ra_ide/src/inlay_hints.rs | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'crates/ra_ide/src') diff --git a/crates/ra_ide/src/inlay_hints.rs b/crates/ra_ide/src/inlay_hints.rs index 6b0d3d996..2ae97e65f 100644 --- a/crates/ra_ide/src/inlay_hints.rs +++ b/crates/ra_ide/src/inlay_hints.rs @@ -80,8 +80,7 @@ fn get_inlay_hints( }, ast::MatchArmList(it) => { it.arms() - .map(|match_arm| match_arm.pats()) - .flatten() + .filter_map(|match_arm| match_arm.pat()) .for_each(|root_pat| get_pat_type_hints(acc, db, &analyzer, root_pat, true, max_inlay_hint_length)); }, ast::CallExpr(it) => { @@ -202,6 +201,7 @@ fn get_leaf_pats(root_pat: ast::Pat) -> Vec { Some(pat) => pats_to_process.push_back(pat), _ => leaf_pats.push(maybe_leaf_pat), }, + ast::Pat::OrPat(ref_pat) => pats_to_process.extend(ref_pat.pats()), ast::Pat::TuplePat(tuple_pat) => pats_to_process.extend(tuple_pat.args()), ast::Pat::RecordPat(record_pat) => { if let Some(pat_list) = record_pat.record_field_pat_list() { @@ -222,6 +222,7 @@ fn get_leaf_pats(root_pat: ast::Pat) -> Vec { ast::Pat::TupleStructPat(tuple_struct_pat) => { pats_to_process.extend(tuple_struct_pat.args()) } + ast::Pat::ParenPat(inner_pat) => pats_to_process.extend(inner_pat.pat()), ast::Pat::RefPat(ref_pat) => pats_to_process.extend(ref_pat.pat()), _ => (), } -- cgit v1.2.3