Skip to content
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

Complete switch constructor #415

Merged
merged 12 commits into from
May 12, 2022
Prev Previous commit
Next Next commit
One more test case.
  • Loading branch information
cristianoc committed May 12, 2022
commit e53b51e7fea556e9c0e28c6ae0f5716ef52beac4
8 changes: 8 additions & 0 deletions analysis/tests/src/Completion.res
Original file line number Diff line number Diff line change
Expand Up @@ -367,3 +367,11 @@ let _ = x =>

// let _ = x => switch x { | T
// ^com

let _ = x =>
switch x {
// | T
// ^com
| _ if false => 4
| _ => 4
}
10 changes: 8 additions & 2 deletions analysis/tests/src/expected/Completion.res.txt
Original file line number Diff line number Diff line change
Expand Up @@ -1390,8 +1390,14 @@ XXX Pexp_match with 1 cases not handled
[]

Complete tests/src/Completion.res 367:30
posCursor:[367:30] posNoWhite:[367:29] Found expr:[367:11->367:30]
posCursor:[367:30] posNoWhite:[367:29] Found expr:[367:16->367:30]
posCursor:[367:30] posNoWhite:[367:29] Found expr:[367:11->376:3]
posCursor:[367:30] posNoWhite:[367:29] Found expr:[367:16->376:3]
XXX Pexp_match with 1 cases not handled
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This shows that parser recovery also gives 1 case when no more cases others follow.

[]

Complete tests/src/Completion.res 372:8
posCursor:[372:8] posNoWhite:[372:7] Found expr:[370:8->376:3]
posCursor:[372:8] posNoWhite:[372:7] Found expr:[371:2->376:3]
XXX Pexp_match with 2 cases not handled
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This example confirms that the first 2 cases are squashed into one.

[]