Wingman: Destruct on empty case#1721
Merged
Merged
Conversation
Collaborator
|
I wonder if this would be better to implement as a completion rather than a code action? |
This reverts commit fc8d8e5.
This reverts commit 23e5d06.
isovector
marked this pull request as ready for review
April 15, 2021 05:49
pepeiborra
approved these changes
Apr 15, 2021
pepeiborra
left a comment
Collaborator
There was a problem hiding this comment.
This is awesome! I have wanted this feature so many times!
Comment on lines
117
to
122
| instance Show (HsExpr GhcPs) where | ||
| show = unsafeRender | ||
|
|
||
| instance Show (HsExpr GhcTc) where | ||
| show = unsafeRender | ||
|
|
||
| instance Show (HsDecl GhcPs) where | ||
| show = unsafeRender | ||
|
|
Collaborator
There was a problem hiding this comment.
Please consider moving these to the Orphans module
Collaborator
Author
There was a problem hiding this comment.
Happy to --- followup PR ok?
This file contains hidden or 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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
This PR adds a code lens to empty
case x ofexpressions, offering to expand out their pattern matches. It works by looking for empty case matches, typechecking their scrutinee, and then grafting newly generatedMatches back into the AST. Seems to work pretty well.Fixes #1716