Don't wrap argument list containing anonymous functions

Just like for objects and lambdas, don't consider line breaks inside
anonymous functions as line breaks inside argument list
This commit is contained in:
Dmitry Jemerov
2018-01-08 15:18:09 +01:00
parent a5cc9809ac
commit 67897d9b3d
3 changed files with 15 additions and 0 deletions
@@ -581,6 +581,13 @@ private fun excludeLambdasAndObjects(parent: ASTBlock): List<TextRange> {
super.visitObjectLiteralExpression(expression)
rangesToExclude.add(expression.textRange)
}
override fun visitNamedFunction(function: KtNamedFunction) {
super.visitNamedFunction(function)
if (function.name == null) {
rangesToExclude.add(function.textRange)
}
}
})
return TextRangeUtil.excludeRanges(parent.textRange, rangesToExclude).toList()
}
@@ -14,6 +14,10 @@ fun main(args: Array<String>) {
println("Hello world")
}
})
useCallable("B", fun() {
println("Hello world")
})
}
// SET_TRUE: CALL_PARAMETERS_LPAREN_ON_NEXT_LINE
+4
View File
@@ -14,6 +14,10 @@ fun main(args: Array<String>) {
println("Hello world")
}
})
useCallable("B", fun() {
println("Hello world")
})
}
// SET_TRUE: CALL_PARAMETERS_LPAREN_ON_NEXT_LINE