Skip to content

Handle properly stringifying multiline calls#15691

Merged
straight-shoota merged 1 commit intocrystal-lang:masterfrom
Blacksmoke16:multiline-call-string-representation
Apr 24, 2025
Merged

Handle properly stringifying multiline calls#15691
straight-shoota merged 1 commit intocrystal-lang:masterfrom
Blacksmoke16:multiline-call-string-representation

Conversation

@Blacksmoke16
Copy link
Member

Previously code like:

{%
  vals = [4, 1, 12]
    .sort_by do |v| v end
    .map do |v| v end
%}

{%
  vals = "foo"
    .strip
    .strip.strip
%}

Would always be stringified as:

{%
  vals = [4, 1, 12].sort_by do |v| v end.map do |v| v end
%}

{%
  vals = "foo".strip.strip.strip
%}

With this PR it now remains unchanged.

@straight-shoota straight-shoota added this to the 1.17.0 milestone Apr 22, 2025
@straight-shoota straight-shoota merged commit 87a26e3 into crystal-lang:master Apr 24, 2025
36 checks passed
@Blacksmoke16 Blacksmoke16 deleted the multiline-call-string-representation branch April 25, 2025 12:01
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants