File tree Expand file tree Collapse file tree 1 file changed +15
-3
lines changed Expand file tree Collapse file tree 1 file changed +15
-3
lines changed Original file line number Diff line number Diff line change @@ -493,9 +493,21 @@ module Structure =
493493 | x -> x
494494
495495 let synPat = getLastPat synPat
496- // Collapse the scope starting with `->`
497- let collapse = Range.endToEnd synPat.Range clause.Range
498- rcheck Scope.MatchClause Collapse.Same e.Range collapse
496+ let synPatRange = synPat.Range
497+ let resultExprRange = e.Range
498+
499+ // Avoid rcheck because we want to be able to collapse resultExpr even if it spans a single line
500+ // but is not on the same one as the pattern
501+ if synPatRange.EndLine <> resultExprRange.EndLine then
502+ acc.Add
503+ {
504+ Scope = Scope.MatchClause
505+ Collapse = Collapse.Same
506+ Range = resultExprRange
507+ // Collapse the scope starting with `->`
508+ CollapseRange = Range.endToEnd synPatRange clause.Range
509+ }
510+
499511 parseExpr e
500512
501513 and parseAttributes ( Attributes attrs ) =
You can’t perform that action at this time.
0 commit comments