Skip to content

Fix multiline pipe rendering#128

Open
WhileTruu wants to merge 1 commit intomdgriffith:mainfrom
WhileTruu:fix-multiline-pipe-rendering
Open

Fix multiline pipe rendering#128
WhileTruu wants to merge 1 commit intomdgriffith:mainfrom
WhileTruu:fix-multiline-pipe-rendering

Conversation

@WhileTruu
Copy link

Fixes #127

Copy link
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
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
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
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

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

2 participants