-
Notifications
You must be signed in to change notification settings - Fork 57
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
Changes from 4 commits
Commits
Show all changes
12 commits
Select commit
Hold shift + click to select a range
1b0b750
Add example of missing complete for constructor in switch.
cristianoc bea7472
Add debug for Pexp_match.
cristianoc 9d5b17c
Add one more test case.
cristianoc e53b51e
One more test case.
cristianoc 88cae89
Show location of pattern and expression of first switch case.
cristianoc 9d59306
Inspect patterns in the AST.
cristianoc 91f20b0
Print pattern constructor.
cristianoc 8eb112a
Remove debugging of switched to clean up the output.
cristianoc 7a9b38a
Remove additional tests.
cristianoc 74c5a7b
Add test with a more complex constructor path.
cristianoc 73bf47c
Use the pattern path found to trigger completion.
cristianoc 8ea472d
Clean up debug output.
cristianoc File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -956,6 +956,7 @@ Completable: Cnone | |
|
||
Complete tests/src/Completion.res 243:8 | ||
posCursor:[243:8] posNoWhite:[243:7] Found expr:[241:8->246:1] | ||
XXX Pexp_match with 1 cases not handled | ||
posCursor:[243:8] posNoWhite:[243:7] Found expr:[242:14->245:8] | ||
posCursor:[243:8] posNoWhite:[243:7] Found expr:[242:14->245:1] | ||
Pexp_apply ...[243:3->243:4] (...[242:14->242:15], ...[243:5->245:1]) | ||
|
@@ -1332,6 +1333,7 @@ Completable: Cpath Type[Res] | |
|
||
Complete tests/src/Completion.res 343:57 | ||
posCursor:[343:57] posNoWhite:[343:56] Found expr:[343:10->346:23] | ||
XXX Pexp_match with 1 cases not handled | ||
posCursor:[343:57] posNoWhite:[343:56] Found expr:[343:53->346:23] | ||
posCursor:[343:57] posNoWhite:[343:56] Found expr:[343:53->343:57] | ||
Pexp_ident this:[343:53->343:57] | ||
|
@@ -1381,3 +1383,21 @@ posCursor:[355:23] posNoWhite:[355:22] Found expr:[0:-1->355:23] | |
posCursor:[355:23] posNoWhite:[355:22] Found expr:[355:12->355:23] | ||
[] | ||
|
||
Complete tests/src/Completion.res 362:8 | ||
posCursor:[362:8] posNoWhite:[362:7] Found expr:[360:8->365:3] | ||
posCursor:[362:8] posNoWhite:[362:7] Found expr:[361:2->365:3] | ||
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->376:3] | ||
posCursor:[367:30] posNoWhite:[367:29] Found expr:[367:16->376:3] | ||
XXX Pexp_match with 1 cases not handled | ||
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 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 | ||
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 example confirms that the first 2 cases are squashed into one. |
||
[] | ||
|
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
This shows that parser recovery leads to a single case being considered in the switch.