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

Support for passing an indentation level to toString #60

Open
wolfadex opened this issue Dec 15, 2022 · 0 comments
Open

Support for passing an indentation level to toString #60

wolfadex opened this issue Dec 15, 2022 · 0 comments

Comments

@wolfadex
Copy link

When combining elm-codegen with elm-review you can end up with invalid indentation. E.g. given

{-| @generated-by_elm-review-codegen
-}
encodeTuple : ( Bool, Int ) -> Json.Encode.Value
encodeTuple foo = Debug.todo ""

and expecting the result of

encodeTuple : ( Bool, Int ) -> Json.Encode.Value
encodeTuple foo =
    case food of
        ( first, second ) ->
            Json.Encode.list identity
                [ Json.Encode.bool first, Json.Encode.int second ]

or possibly

encodeTuple : ( Bool, Int ) -> Json.Encode.Value
encodeTuple foo = case food of
                                  ( first, second ) ->
                                          Json.Encode.list identity
                                                  [ Json.Encode.bool first, Json.Encode.int second ]

but instead I get

encodeTuple : ( Bool, Int ) -> Json.Encode.Value
encodeTuple foo = case foo of
    ( first, second ) ->
        Json.Encode.list identity
            [ Json.Encode.bool first, Json.Encode.int second ]

Given that I have indentation information from elm-review it'd be nice to be able to do Elm.toStringWithIndentationOf range.start.column someExpression (or such).

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

No branches or pull requests

1 participant