Skip to content

Improve "pattern match on value" code action to make it work on lists and more patterns #4808

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

Open
wants to merge 4 commits into
base: main
Choose a base branch
from

Conversation

giacomocavalieri
Copy link
Member

@giacomocavalieri giacomocavalieri commented Jul 24, 2025

With this PR the "pattern match on value/argument" code action:

  • now works on lists, generating the patterns for the empty and non empty list
  • now works on variables inside other destructuring patterns

Here's a little example of what is now possible!

wibble.mov

Fixes #4806
Fixes #4807

@lpil
Copy link
Member

lpil commented Jul 24, 2025

Drafting as there's failing tests atm!

P.S. may want to use mp4 rather than mov so everyone can play the video

@lpil lpil marked this pull request as draft July 24, 2025 17:09
@giacomocavalieri
Copy link
Member Author

Oops I forgot a test! It should be all good now

@giacomocavalieri giacomocavalieri marked this pull request as ready for review July 24, 2025 19:23
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.

Pattern match on variable doesn't work on nested variables inside a pattern Pattern match on variable/argument code action doesn't work on lists
2 participants