KT-1912 Formatter: smart indent doesn't work in a function literal

#KT-1099 fixed
 #KT-1912 fixed
This commit is contained in:
Nikolay Krasko
2012-05-11 18:22:27 +04:00
parent 3af2b1b80a
commit 5ac866ba3c
4 changed files with 8 additions and 16 deletions
@@ -46,7 +46,8 @@ public class JetBlock extends AbstractBlock {
private static final TokenSet CODE_BLOCKS = TokenSet.create(
JetNodeTypes.BLOCK,
JetNodeTypes.CLASS_BODY,
JetNodeTypes.FUNCTION_LITERAL_EXPRESSION);
JetNodeTypes.FUNCTION_LITERAL_EXPRESSION,
JetNodeTypes.FUNCTION_LITERAL);
// private static final List<IndentWhitespaceRule>
@@ -1,11 +1,7 @@
package testing
private fun times<T>(times : Int, body : () -> T) {
for (var i in 1..times) {
body()
}
}
private fun times<T>(times : Int, body : () -> T) {}
fun main(args: Array<String>) {
times(3) {<caret>
}
times(3) {<caret>}
}
@@ -1,13 +1,9 @@
package testing
private fun times<T>(times : Int, body : () -> T) {
for (var i in 1..times) {
body()
}
}
private fun times<T>(times : Int, body : () -> T) {}
fun main(args: Array<String>) {
times(3) {
<caret>
}
}
}
@@ -49,8 +49,7 @@ public class JetTypingIndentationTest extends LightCodeInsightTestCase {
doFileNewlineTest();
}
// TODO
public void enabletestFunctionBlock() {
public void testFunctionBlock() {
doFileNewlineTest();
}