Change formatting of function expressions without names

No spaces between 'fun' and value parameter list
This commit is contained in:
Denis Zharkov
2015-05-19 11:17:06 +03:00
parent 2deb7faf05
commit b650753643
8 changed files with 19 additions and 13 deletions
@@ -139,6 +139,7 @@ fun createSpacingBuilder(settings: CodeStyleSettings): KotlinSpacingBuilder {
betweenInside(FUN_KEYWORD, IDENTIFIER, FUN).spaces(1) betweenInside(FUN_KEYWORD, IDENTIFIER, FUN).spaces(1)
betweenInside(FUN_KEYWORD, TYPE_REFERENCE, FUN).spaces(1) betweenInside(FUN_KEYWORD, TYPE_REFERENCE, FUN).spaces(1)
betweenInside(FUN_KEYWORD, VALUE_PARAMETER_LIST, FUN).spacing(0, 0, 0, false, 0)
betweenInside(TYPE_REFERENCE, DOT, FUN).spacing(0, 0, 0, false, 0) betweenInside(TYPE_REFERENCE, DOT, FUN).spacing(0, 0, 0, false, 0)
betweenInside(DOT, IDENTIFIER, FUN).spacing(0, 0, 0, false, 0) betweenInside(DOT, IDENTIFIER, FUN).spacing(0, 0, 0, false, 0)
afterInside(IDENTIFIER, FUN).spacing(0, 0, 0, false, 0) afterInside(IDENTIFIER, FUN).spacing(0, 0, 0, false, 0)
@@ -17,6 +17,8 @@ val c = fun() = 4
fun test() = fun test() = 4 fun test() = fun test() = 4
fun test() { fun test() {
test(fun() {
})
test(fun test() { test(fun test() {
}) })
test(fun test() = 5) test(fun test() = 5)
@@ -13,6 +13,9 @@ val c = fun() = 4
fun test() = fun test() = 4 fun test() = fun test() = 4
fun test() { fun test() {
test(fun
() {
})
test(fun test() {}) test(fun test() {})
test(fun test() = 5) test(fun test() = 5)