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

Add code action to wrap case clause body in braces #4375

Open
matiascr opened this issue Mar 20, 2025 · 2 comments
Open

Add code action to wrap case clause body in braces #4375

matiascr opened this issue Mar 20, 2025 · 2 comments
Labels
help wanted Contributions encouraged priority:medium

Comments

@matiascr
Copy link
Contributor

Add a code action that extracts the right hand side of a case clause into its own block.
Basically what "Add braces to arm expression" does in Rust.

Before:

  case result {
    Ok(value) -> value + 1
                 ^^^^^^^^^
    Error(_) -> panic
  }

After:

  case result {
    Ok(value) -> {
      value + 1
    }
    Error(_) -> panic
  }
@lpil
Copy link
Member

lpil commented Mar 21, 2025

Great idea! Thank you

@lpil lpil added help wanted Contributions encouraged priority:medium labels Mar 21, 2025
@matiascr
Copy link
Contributor Author

I'm already working on this

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
help wanted Contributions encouraged priority:medium
Projects
None yet
Development

No branches or pull requests

2 participants