Skip to content

Fix multiline pipe rendering#128

Merged
mdgriffith merged 1 commit intomdgriffith:mainfrom
WhileTruu:fix-multiline-pipe-rendering
Mar 26, 2026
Merged

Fix multiline pipe rendering#128
mdgriffith merged 1 commit intomdgriffith:mainfrom
WhileTruu:fix-multiline-pipe-rendering

Conversation

@WhileTruu
Copy link
Copy Markdown
Contributor

Fixes #127

Copy link
Copy Markdown
Contributor

@miniBill miniBill left a comment

Choose a reason for hiding this comment

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

I'm not sure I follow how it's doing the +4 now, but the tests make sense to me

@WhileTruu
Copy link
Copy Markdown
Contributor Author

All I know is that keeping the +4 results in this:

hello : String
hello =
    String.replace "6" "!" <|
        String.replace "5" "d" <|
                String.replace "4" "l" <|
                            String.replace "3" "r" <|
                                            String.replace "2" "o" <|
                                                                String.replace
                                                                                        "1"
                                                                                        "W" <|
                                                                                        "123456"

😀

@miniBill
Copy link
Copy Markdown
Contributor

Yeah, tbh I just trusts the tests. I could try running it on a bigger codebase and see what happens if @mdgriffith wants

@miniBill
Copy link
Copy Markdown
Contributor

Tested it in elm-open-api-cli. It's so much better before elm-format, and mostly better after elm-format.

The only regression I found is that a ++ "foo" now gets split, but the tradeoff is super worth it and we can fix that one separately

@mdgriffith mdgriffith merged commit 27a609c into mdgriffith:main Mar 26, 2026
1 check passed
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.

Pipes in generated code are not on new lines since 4.2.1

3 participants