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

Generate exhaustive pattern match for sealed types. #643

Merged
merged 2 commits into from Apr 9, 2019

Conversation

olafurpg
Copy link
Member

@olafurpg olafurpg commented Apr 9, 2019

Fixes #630.

Previously, you had to write on case at a time when pattern matching on
a sealed type. Now, you can complete on the match keyword and select
the "match (exhaustive)" completion item to generate all cases. This
commit also introduces a new "match" completion (non-exhaustive) that
generates a single case and triggers a new completion at the case word,
for editors that support CompletionItem.command.

2019-04-09 08 51 20

Previously, you had to write on case at a time when pattern matching on
a sealed type. Now, you can complete on the `match` keyword and select
the "match (exhaustive)" completion item to generate all cases.  This
commit also introduces a new "match" completion (non-exhaustive) that
generates a single case and triggers a new completion at the case word,
for editors that support `CompletionItem.command`.
The `knownDirectSubClasses` method works less reliably in 2.11 compared
to 2.12.
@olafurpg olafurpg merged commit ac9c01e into scalameta:master Apr 9, 2019
@olafurpg olafurpg deleted the exhaustive-match branch April 9, 2019 15:07
@olafurpg olafurpg added this to the Metals v0.5 - Mercury milestone Apr 12, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Complete exhaustive match expression for sealed types
1 participant