Skip to content

Conversation

zth
Copy link
Member

@zth zth commented Aug 18, 2023

This introduces a code action for inserting an exhaustive switch. Works for variants, polyvariants, options, and bools. It can be triggered in the following ways:

Putting the cursor on an identifier

ca-es-identifier.mov

Selecting an expression

ca-es-selection.mov

@zth zth requested a review from cristianoc August 18, 2023 18:12
Comment on lines +781 to +786
(match findThisExprLoc with
| Some loc when expr.pexp_loc = loc -> (
match exprToContextPath expr with
| None -> ()
| Some ctxPath -> setResult (Cpath ctxPath))
| _ -> ());
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is pretty messy to include like this in the existing autocomplete. But, it's a pretty valuable feature, and this part of the code base needs a big refactor soon anyway, so I think it's OK given what it enables.

@zth zth merged commit 09fd729 into master Aug 18, 2023
@zth zth deleted the more-exhaustive-switches branch August 18, 2023 19:17
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.

2 participants