Skip to content

Formatter bug re: multiline calls with heredoc argument #17026

Description

@Sija

It seems I've found a bug in the current formatter (Crystal v1.20.2):

foo(
  <<-HEREDOC,
    foo
    HEREDOC
)

foo[
  <<-HEREDOC,
    foo
    HEREDOC
]

gets formatted to:

foo(
  <<-HEREDOC
    foo
    HEREDOC
,
)

foo[
  <<-HEREDOC,
    foo
    HEREDOC

]

The same happens for a named argument as well.

Originally posted by @Sija in #17018 (comment)

Metadata

Metadata

Assignees

No one assigned

    Labels

    kind:bugA bug in the code. Does not apply to documentation, specs, etc.topic:tools:formatter

    Type

    Fields

    No fields configured for Bug.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions