-
-
Notifications
You must be signed in to change notification settings - Fork 378
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
Wingman: Destruct on empty case #1721
Conversation
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.
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 is awesome! I have wanted this feature so many times!
instance Show (HsExpr GhcPs) where | ||
show = unsafeRender | ||
|
||
instance Show (HsExpr GhcTc) where | ||
show = unsafeRender | ||
|
||
instance Show (HsDecl GhcPs) where | ||
show = unsafeRender | ||
|
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.
Please consider moving these to the Orphans module
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.
Happy to --- followup PR ok?
This PR adds a code lens to empty
case x of
expressions, offering to expand out their pattern matches. It works by looking for empty case matches, typechecking their scrutinee, and then grafting newly generatedMatch
es back into the AST. Seems to work pretty well.Fixes #1716