Filling out the template is required. Any pull request that does not include enough information to be reviewed in a timely manner may be closed at the maintainers' discretion.
All new code requires tests to ensure against regressions
Description of the Change
The changes introduced in https://github.com/atom/language-python/pull/292 made it impossible to fold an if_statement without an elif_clause and/or else_clause. This PR fixes this by adding back if_statement to the fold rules and rearranges the rules so the rule that ends with elif_clause and else_clause types take precedence.
Requirements
Description of the Change
The changes introduced in https://github.com/atom/language-python/pull/292 made it impossible to fold an
if_statement
without anelif_clause
and/orelse_clause
. This PR fixes this by adding backif_statement
to the fold rules and rearranges the rules so the rule that ends withelif_clause
andelse_clause
types take precedence.Before:
After:
Alternate Designs
No
Benefits
Can fold lonely if statements again
Possible Drawbacks
No
Applicable Issues
Folding part of https://github.com/atom/language-python/issues/299
/cc: @daviwil FYI