Skip to content

Conversation

@pelletencate
Copy link

@pelletencate pelletencate commented Jul 4, 2024

Previously, whenever a block is being opened, we assume we can't format them because a SyntaxTree can't be established based on an unended block.

This PR attempts to resolve that for most blocks by doing the following:

  1. If it's a do block: assume you get a valid Ruby statement if you remove the terminating do or { and the parameter list
  2. If it's an if, unless, while or until block: assume you get a valid Ruby expression if you remove the first word (if/unless/while/until).

This will successfully format most blocks open statements.

Dependencies:

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.

1 participant