-
Notifications
You must be signed in to change notification settings - Fork 790
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Filter type test completion list #12930
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -459,7 +459,7 @@ module SyntaxTraversal = | |
|
||
| SynExpr.Match (expr=synExpr; clauses=synMatchClauseList) -> | ||
[yield dive synExpr synExpr.Range traverseSynExpr | ||
yield! synMatchClauseList |> List.map (fun x -> dive x x.RangeOfGuardAndRhs (traverseSynMatchClause path))] | ||
yield! synMatchClauseList |> List.map (fun x -> dive x x.Range (traverseSynMatchClause path))] | ||
|> pick expr | ||
|
||
| SynExpr.Do (synExpr, _range) -> traverseSynExpr synExpr | ||
|
@@ -632,7 +632,8 @@ module SyntaxTraversal = | |
let path = SyntaxNode.SynPat p :: origPath | ||
match p with | ||
| SynPat.Paren (p, _) -> traversePat path p | ||
| SynPat.Or (p1, p2, _, _) -> [ p1; p2] |> List.tryPick (traversePat path) | ||
| SynPat.As (p1, p2, _) | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This looked like an omission. I don't see why we wouldn't want to dive into both subpatterns here. Without it There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. completely agree with this logic |
||
| SynPat.Or (p1, p2, _, _) -> [ p1; p2 ] |> List.tryPick (traversePat path) | ||
| SynPat.Ands (ps, _) | ||
| SynPat.Tuple (_, ps, _) | ||
| SynPat.ArrayOrList (_, ps, _) -> ps |> List.tryPick (traversePat path) | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't know why
RangeOfGuardAndRhs
was used here.MatchLambda
andTryWith
traversals useRange
, so this change seemed appropriate. Without itVisitPat
is never fired in a match clause pattern, and so we don't get a chance to create the right completion context.