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

Fix formatting of 1\n.as(Int32) #7347

Merged
merged 4 commits into from
Feb 1, 2019

Conversation

asterite
Copy link
Member

@asterite asterite commented Jan 30, 2019

Fixes #6006

This PR consists of two commits:

  1. Let the formatter create fake Calls for special calls like is_a?, as and responds_to? and format these calls. This removes a lot of code that was special-cased for this. In this way the logic of formatting calls (which isn't that trivial because it tries to align columns, for example) is kept unified for all these calls.
  2. That commit alone already fixes Formatter can't format 1\n.as(Int32) #6006 but I added a couple of specs to prove it

@asterite asterite added kind:bug A bug in the code. Does not apply to documentation, specs, etc. topic:tools:formatter labels Jan 30, 2019
@asterite asterite self-assigned this Jan 30, 2019
@asterite
Copy link
Member Author

I added a couple of commits because I fixed some things but broke others. Now everything should work fine. Later we can squash merge all commits.

@RX14 RX14 merged commit 3993e89 into crystal-lang:master Feb 1, 2019
@RX14 RX14 added this to the 0.28.0 milestone Feb 1, 2019
@asterite asterite deleted the bug/formatter-as-in-newline branch March 30, 2019 16:35
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kind:bug A bug in the code. Does not apply to documentation, specs, etc. topic:tools:formatter
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Formatter can't format 1\n.as(Int32)
3 participants