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

Formatter: correctly indent implicit exception handler of do/end block #5176

Conversation

makenowjust
Copy link
Contributor

Fixed #5175

Now, crystal tool format keeps this code.

loop do
  loop do
    1
  rescue
    2
  end
end

Thanks for reporting, @straight-shoota!

@@ -62,7 +62,7 @@ module Crystal
@inside_lib : Int32
@inside_struct_or_union : Int32
@dot_column : Int32?
@def_indent : Int32
@implicit_exception_handler_indent : Int32
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Would just exception_handler_indent be an equally good name?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, @implicit_exception_handler_indent looks too long to me, but implicit is important as same as that.

@asterite asterite merged commit 2d2ebac into crystal-lang:master Oct 25, 2017
@makenowjust makenowjust deleted the fix/crystal-format/indent-implicit-exception-handler-with-do-end branch October 25, 2017 14:35
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.

None yet

4 participants