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(
|
private static final TokenSet CODE_BLOCKS = TokenSet.create(
|
||||||
JetNodeTypes.BLOCK,
|
JetNodeTypes.BLOCK,
|
||||||
JetNodeTypes.CLASS_BODY,
|
JetNodeTypes.CLASS_BODY,
|
||||||
JetNodeTypes.FUNCTION_LITERAL_EXPRESSION);
|
JetNodeTypes.FUNCTION_LITERAL_EXPRESSION,
|
||||||
|
JetNodeTypes.FUNCTION_LITERAL);
|
||||||
|
|
||||||
// private static final List<IndentWhitespaceRule>
|
// private static final List<IndentWhitespaceRule>
|
||||||
|
|
||||||
|
|||||||
@@ -1,11 +1,7 @@
|
|||||||
package testing
|
package testing
|
||||||
|
|
||||||
private fun times<T>(times : Int, body : () -> T) {
|
private fun times<T>(times : Int, body : () -> T) {}
|
||||||
for (var i in 1..times) {
|
|
||||||
body()
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
fun main(args: Array<String>) {
|
fun main(args: Array<String>) {
|
||||||
times(3) {<caret>
|
times(3) {<caret>}
|
||||||
}
|
}
|
||||||
@@ -1,10 +1,6 @@
|
|||||||
package testing
|
package testing
|
||||||
|
|
||||||
private fun times<T>(times : Int, body : () -> T) {
|
private fun times<T>(times : Int, body : () -> T) {}
|
||||||
for (var i in 1..times) {
|
|
||||||
body()
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
fun main(args: Array<String>) {
|
fun main(args: Array<String>) {
|
||||||
times(3) {
|
times(3) {
|
||||||
|
|||||||
@@ -49,8 +49,7 @@ public class JetTypingIndentationTest extends LightCodeInsightTestCase {
|
|||||||
doFileNewlineTest();
|
doFileNewlineTest();
|
||||||
}
|
}
|
||||||
|
|
||||||
// TODO
|
public void testFunctionBlock() {
|
||||||
public void enabletestFunctionBlock() {
|
|
||||||
doFileNewlineTest();
|
doFileNewlineTest();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user