KT-1912 Formatter: smart indent doesn't work in a function literal
#KT-1099 fixed #KT-1912 fixed
This commit is contained in:
@@ -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();
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user