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

Quick fix to add missing pattern matching #2886

Open
Tracked by #15408
Thorium opened this issue Apr 20, 2017 · 2 comments
Open
Tracked by #15408

Quick fix to add missing pattern matching #2886

Thorium opened this issue Apr 20, 2017 · 2 comments
Labels
Area-LangService-CodeFixes Code fixes associated with diagnostics Feature Request
Milestone

Comments

@Thorium
Copy link
Contributor

Thorium commented Apr 20, 2017

Suggestion to code editor quick fixes:

example

When matching over enum or discriminated union type, and gotten warning "Incomplete pattern matches", provide a quick hint fix possibility to add missing enums.

@kerams
Copy link
Contributor

kerams commented Apr 15, 2022

I'd say this should be fairly easy to achieve when you don't have any clauses typed out yet. Finding out the missing cases can otherwise be very tricky, what with active patterns, when guards, subpatterns... Yes, the compiler will (always?) give you an example of something that's not covered, but I'm not sure it's viable for it to provide an exhaustive list of missing cases.

@psfinaki
Copy link
Member

Good point @kerams. We could probably have this only for simple cases like type DU = | A | B | C.

@psfinaki psfinaki changed the title match enum with quick fix to add missing enums Quick fix to add missing pattern matching Jun 15, 2023
@psfinaki psfinaki mentioned this issue Jun 15, 2023
85 tasks
@vzarytovskii vzarytovskii reopened this Jan 4, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Area-LangService-CodeFixes Code fixes associated with diagnostics Feature Request
Projects
Archived in project
Development

No branches or pull requests

7 participants