Created
November 8, 2012 18:25
-
-
Save non/4040577 to your computer and use it in GitHub Desktop.
scala-mode2 indenting status
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| // ok | |
| def foo0(x: Int) = | |
| x match { | |
| case 99 => 123 | |
| case _ => 999 | |
| } | |
| // not great, prefer 1-dedent for last 3 lines | |
| def foo1(x: Int) = x match { | |
| case 99 => 123 | |
| case _ => 999 | |
| } | |
| // ok | |
| def foo2(x: Int) = x + 9 | |
| // ok | |
| def foo3(x: Int) = | |
| x + 9 | |
| // ok | |
| def foo4(x: Int) = | |
| x match { | |
| case 99 => 123 | |
| case _ => 999 | |
| } | |
| // not great, prefer dedent for last 4 lines | |
| def foo5(x: Int) = if (x > 10) { | |
| 123 | |
| } else { | |
| 999 | |
| } | |
| // ok | |
| def foo6(x: Int) = | |
| if (x > 10) { | |
| 123 | |
| } else { | |
| 999 | |
| } | |
| // failed, should resemble 8 but dedent last 4 | |
| def foo7(x: Int) = if (x > 10) | |
| 123 | |
| else | |
| 999 | |
| // ok | |
| def foo8(x: Int) = | |
| if (x > 10) | |
| 123 | |
| else | |
| 999 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment