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

.method calls on new lines has wrong indent when nested #8197

Closed
bew opened this issue Sep 18, 2019 · 0 comments · Fixed by #8315
Closed

.method calls on new lines has wrong indent when nested #8197

bew opened this issue Sep 18, 2019 · 0 comments · Fixed by #8315
Labels
kind:bug A bug in the code. Does not apply to documentation, specs, etc. topic:tools:formatter

Comments

@bew
Copy link
Contributor

bew commented Sep 18, 2019

top_call("foo")
  .first_indent(SomeType.new("bar")
    .second_indent
    .second_indent)
  .first_indent(SomeType.new("baz")
    .second_indent
    .second_indent)

is wrongly formatted as:

top_call("foo")
  .first_indent(SomeType.new("bar")
  .second_indent
  .second_indent)
  .first_indent(SomeType.new("baz")
  .second_indent
  .second_indent)

Which is pretty bad to read..

For now I'm using:

top_call("foo")
  .first_indent(
    SomeType.new("bar")
      .second_indent
      .second_indent)
  .first_indent(
    SomeType.new("baz")
      .second_indent
      .second_indent)

Which is ok, but adds an additional indentation.
Nevertheless, I think the above formatting should be fixed

@bew bew changed the title .method calls on new lines has wrong indent when .method calls on new lines has wrong indent when nested Sep 18, 2019
@RX14 RX14 added kind:bug A bug in the code. Does not apply to documentation, specs, etc. topic:tools:formatter labels Sep 18, 2019
makenowjust added a commit to makenowjust/crystal that referenced this issue Oct 12, 2019
Fixed crystal-lang#8197

Also remove @multiline_call_indent trick introduced by crystal-lang#5234.
It was originally introduced for dot alignment as @dot_column.
However it is removed and this trick can be implemented without any trick.
asterite pushed a commit that referenced this issue Oct 13, 2019
Fixed #8197

Also remove @multiline_call_indent trick introduced by #5234.
It was originally introduced for dot alignment as @dot_column.
However it is removed and this trick can be implemented without any trick.
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 a pull request may close this issue.

2 participants