-
Notifications
You must be signed in to change notification settings - Fork 4
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
[CodeAction] Add missing cases to a match statement #350
Comments
Since your example is using Scala 3 I'll add in that as of this pr these types of quick fixes can actually come right from the compiler. So in theory you could make a feature request there as well, and then anything using the newer versions of the compiler irregardless of client/Metals/IntelliJ would benefit from it. |
This was referenced Jul 30, 2023
dwijnand
added a commit
to scala/scala3
that referenced
this issue
Aug 9, 2023
The purpose of this PR is to add an actionable item for non-exhaustive pattern match diagnostic, so that people can auto insert missing cases. Relates to scalameta/metals-feature-requests#350
Done via scala/scala3#18314 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Is your feature request related to a problem? Please describe.
Let's imagine that we have a following match statement over some ADT:
We then modify ADT by adding two more cases -
Double
andFloat
.Now, the compiler warns/emits error (depending on the project settings) that the match might not be exhaustive.
Describe the solution you'd like
I would like to have a code action that can be invoked on the mentioned match statement, that, when accepted, would add missing cases with
???
as implementation.Describe alternatives you've considered
Write each missing case taking advantage from completions.
Additional context
No response
Search terms
code-action match case
The text was updated successfully, but these errors were encountered: