{"action":"created","issue":{"url":"https://api.github.com/repos/avh4/elm-format/issues/10","labels_url":"https://api.github.com/repos/avh4/elm-format/issues/10/labels{/name}","comments_url":"https://api.github.com/repos/avh4/elm-format/issues/10/comments","events_url":"https://api.github.com/repos/avh4/elm-format/issues/10/events","html_url":"https://github.com/avh4/elm-format/issues/10","id":112298188,"number":10,"title":"How to indent complex indented expressions inside of lists and other partially-indented contexts","user":{"login":"avh4","id":1222,"avatar_url":"https://avatars.githubusercontent.com/u/1222?v=3","gravatar_id":"","url":"https://api.github.com/users/avh4","html_url":"https://github.com/avh4","followers_url":"https://api.github.com/users/avh4/followers","following_url":"https://api.github.com/users/avh4/following{/other_user}","gists_url":"https://api.github.com/users/avh4/gists{/gist_id}","starred_url":"https://api.github.com/users/avh4/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/avh4/subscriptions","organizations_url":"https://api.github.com/users/avh4/orgs","repos_url":"https://api.github.com/users/avh4/repos","events_url":"https://api.github.com/users/avh4/events{/privacy}","received_events_url":"https://api.github.com/users/avh4/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/avh4/elm-format/labels/discussion","name":"discussion","color":"5319e7"}],"state":"open","locked":false,"assignee":null,"milestone":{"url":"https://api.github.com/repos/avh4/elm-format/milestones/1","html_url":"https://github.com/avh4/elm-format/milestones/MVP","labels_url":"https://api.github.com/repos/avh4/elm-format/milestones/1/labels","id":1365483,"number":1,"title":"MVP","description":"","creator":{"login":"avh4","id":1222,"avatar_url":"https://avatars.githubusercontent.com/u/1222?v=3","gravatar_id":"","url":"https://api.github.com/users/avh4","html_url":"https://github.com/avh4","followers_url":"https://api.github.com/users/avh4/followers","following_url":"https://api.github.com/users/avh4/following{/other_user}","gists_url":"https://api.github.com/users/avh4/gists{/gist_id}","starred_url":"https://api.github.com/users/avh4/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/avh4/subscriptions","organizations_url":"https://api.github.com/users/avh4/orgs","repos_url":"https://api.github.com/users/avh4/repos","events_url":"https://api.github.com/users/avh4/events{/privacy}","received_events_url":"https://api.github.com/users/avh4/received_events","type":"User","site_admin":false},"open_issues":13,"closed_issues":4,"state":"open","created_at":"2015-10-20T05:19:39Z","updated_at":"2015-10-20T15:48:23Z","due_on":null,"closed_at":null},"comments":5,"created_at":"2015-10-20T06:42:07Z","updated_at":"2015-10-20T17:56:37Z","closed_at":null,"body":"For example,\r\n\r\n```elm\r\nmultilineExpressionsInsideList =\r\n    [ let\r\n        x = 1\r\n      in\r\n        x\r\n    , if True then\r\n        2\r\n      else if False then\r\n        3\r\n      else\r\n        4\r\n    , case True of\r\n        _ ->\r\n            5\r\n    , [ 6\r\n      , 7\r\n      ]\r\n        |> head\r\n        |> Maybe.withDefault 8\r\n    , \\a ->\r\n        9\r\n    ]\r\n```\r\n\r\nThe above formatting seems the most natural from the currently defined rules, but this is strange because the `else` is indented two spaces to line up with the `if`, and the body of the `if` is indented 4 spaces from the previous line, but the body of the `else` is indented 2 spaces.\r\n\r\nThe most obvious alternative is to shift the bodies another two spaces over, but this is strange because it breaks us out of the 4-space indentation grid.\r\n\r\nThis will also apply to `let`, `case`, lambdas, and probably any other expression whose second line can be indented.  This also applies to multiline tuples and records.  This probably also applies to tuple and record type definitions."},"comment":{"url":"https://api.github.com/repos/avh4/elm-format/issues/comments/149647649","html_url":"https://github.com/avh4/elm-format/issues/10#issuecomment-149647649","issue_url":"https://api.github.com/repos/avh4/elm-format/issues/10","id":149647649,"user":{"login":"rtfeldman","id":1094080,"avatar_url":"https://avatars.githubusercontent.com/u/1094080?v=3","gravatar_id":"","url":"https://api.github.com/users/rtfeldman","html_url":"https://github.com/rtfeldman","followers_url":"https://api.github.com/users/rtfeldman/followers","following_url":"https://api.github.com/users/rtfeldman/following{/other_user}","gists_url":"https://api.github.com/users/rtfeldman/gists{/gist_id}","starred_url":"https://api.github.com/users/rtfeldman/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/rtfeldman/subscriptions","organizations_url":"https://api.github.com/users/rtfeldman/orgs","repos_url":"https://api.github.com/users/rtfeldman/repos","events_url":"https://api.github.com/users/rtfeldman/events{/privacy}","received_events_url":"https://api.github.com/users/rtfeldman/received_events","type":"User","site_admin":false},"created_at":"2015-10-20T17:56:37Z","updated_at":"2015-10-20T17:56:37Z","body":"I tried both based on Laszlo's style guide suggestion of 4, and I have a minor aesthetic preference for 4.\r\n\r\nI can get behind the idea of 2 making things more consistent and fixing edge cases though. Maybe we should try 2 and see how it goes? Quick enough change I'd assume."}}