{"action":"closed","issue":{"url":"https://api.github.com/repos/scala-ide/scalariform/issues/40","repository_url":"https://api.github.com/repos/scala-ide/scalariform","labels_url":"https://api.github.com/repos/scala-ide/scalariform/issues/40/labels{/name}","comments_url":"https://api.github.com/repos/scala-ide/scalariform/issues/40/comments","events_url":"https://api.github.com/repos/scala-ide/scalariform/issues/40/events","html_url":"https://github.com/scala-ide/scalariform/issues/40","id":2646557,"number":40,"title":"Feature request: indentation of for loops","user":{"login":"fanf","id":44649,"avatar_url":"https://avatars1.githubusercontent.com/u/44649?v=4","gravatar_id":"","url":"https://api.github.com/users/fanf","html_url":"https://github.com/fanf","followers_url":"https://api.github.com/users/fanf/followers","following_url":"https://api.github.com/users/fanf/following{/other_user}","gists_url":"https://api.github.com/users/fanf/gists{/gist_id}","starred_url":"https://api.github.com/users/fanf/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/fanf/subscriptions","organizations_url":"https://api.github.com/users/fanf/orgs","repos_url":"https://api.github.com/users/fanf/repos","events_url":"https://api.github.com/users/fanf/events{/privacy}","received_events_url":"https://api.github.com/users/fanf/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":1,"created_at":"2011-12-23T11:49:38Z","updated_at":"2017-10-25T22:27:25Z","closed_at":"2017-10-25T22:27:25Z","author_association":"NONE","body":"I like to write for loops in that fashion (well, I like it, but the syntax policy at work force me to do so, too), which is for now the more readable I found:\n\n``` scala\n  for {\n    step1      <- somecode\n    longername <- somothercodeWithAblock {\n                    block contents\n                  }\n    aValue     =  someCodeForTheValue\n    otherStep  <- if(sometest) {\n                    blablabla\n                  } else {\n                    bidibidi bidi\n                  }\n  } yield {\n    some result\n  }\n```\n\nThe main indentation rules are:\n- all arrows are vertically aligned\n- '=' for value assignement is aligned with the '<' of arrow, and a space if left to match the '-' of arrows\n- right side of arrows only contains variable names, and so, if the left and side of an arrow span other several line, the block margin start one space after the column of the arrow\n\nFor now, that indentation is not easy to achieve naturally, because scalariform really wants to make spanning line starts two \\* 2 space after the for (even if the workflow was: open '{' at end of line, press enter so that the automatically inserted '}' goes on the next line, align '}' as you want it to be, insert a new line after '{': the cursor is one more time far on the left).  \n\nThat would be a great feature !\n"}}
{"actor":{"display_login":"godenji"}}