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

Formatting: respect break of try finally clause? #77

Open
helixbass opened this issue Mar 31, 2019 · 0 comments
Open

Formatting: respect break of try finally clause? #77

helixbass opened this issue Mar 31, 2019 · 0 comments

Comments

@helixbass
Copy link
Owner

helixbass commented Mar 31, 2019

Adding respectBreak: 'control' support for try/catch (#58/#78), but currently isn't checking/respecting whether a single-expression finally block is indented or not, eg this:

try yes finally
  'nothing'

is formatting like

try yes finally 'nothing'

Not sure if we'd want to be able to separately respect break of try/catch/finally? Eg preserve formatting of above rather than generating

try
  yes
finally
  'nothing'

Would that imply a separate group for the finally clause?

And in terms of detecting/implementing, seems like you could either try and compare last line of catch (if it exists) or try to first line of finally block, or perhaps if that wasn't good enough would want to expose indented in the AST similar to how function bodies do?

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

No branches or pull requests

1 participant