No space between label and lambda in labeled expressions
#KT-22301 Fixed
This commit is contained in:
@@ -259,6 +259,7 @@ fun createSpacingBuilder(settings: CodeStyleSettings, builderUtil: KotlinSpacing
|
|||||||
afterInside(LABEL_QUALIFIER, RETURN).spaces(1)
|
afterInside(LABEL_QUALIFIER, RETURN).spaces(1)
|
||||||
betweenInside(LABEL_QUALIFIER, EOL_COMMENT, LABELED_EXPRESSION).spacing(0, Int.MAX_VALUE, 0, true, kotlinCommonSettings.KEEP_BLANK_LINES_IN_CODE)
|
betweenInside(LABEL_QUALIFIER, EOL_COMMENT, LABELED_EXPRESSION).spacing(0, Int.MAX_VALUE, 0, true, kotlinCommonSettings.KEEP_BLANK_LINES_IN_CODE)
|
||||||
betweenInside(LABEL_QUALIFIER, BLOCK_COMMENT, LABELED_EXPRESSION).spacing(0, Int.MAX_VALUE, 0, true, kotlinCommonSettings.KEEP_BLANK_LINES_IN_CODE)
|
betweenInside(LABEL_QUALIFIER, BLOCK_COMMENT, LABELED_EXPRESSION).spacing(0, Int.MAX_VALUE, 0, true, kotlinCommonSettings.KEEP_BLANK_LINES_IN_CODE)
|
||||||
|
betweenInside(LABEL_QUALIFIER, LAMBDA_EXPRESSION, LABELED_EXPRESSION).spaces(0)
|
||||||
afterInside(LABEL_QUALIFIER, LABELED_EXPRESSION).spaces(1)
|
afterInside(LABEL_QUALIFIER, LABELED_EXPRESSION).spaces(1)
|
||||||
|
|
||||||
betweenInside(FUN_KEYWORD, VALUE_PARAMETER_LIST, FUN).spacing(0, 0, 0, false, 0)
|
betweenInside(FUN_KEYWORD, VALUE_PARAMETER_LIST, FUN).spacing(0, 0, 0, false, 0)
|
||||||
|
|||||||
+1
-1
@@ -5,7 +5,7 @@ fun test1() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
fun test2() {
|
fun test2() {
|
||||||
listOf(1).forEach lit@ {
|
listOf(1).forEach lit@{
|
||||||
if (it == 0) return@lit
|
if (it == 0) return@lit
|
||||||
print(it)
|
print(it)
|
||||||
}
|
}
|
||||||
|
|||||||
+1
-1
@@ -1,6 +1,6 @@
|
|||||||
// IS_APPLICABLE: true
|
// IS_APPLICABLE: true
|
||||||
fun foo() {
|
fun foo() {
|
||||||
bar(l@ { it * 3 })
|
bar(l@{ it * 3 })
|
||||||
}
|
}
|
||||||
|
|
||||||
fun bar(b: (Int) -> Int) {
|
fun bar(b: (Int) -> Int) {
|
||||||
|
|||||||
@@ -3,5 +3,5 @@
|
|||||||
inline fun Int.bar(f: (Int) -> Unit) { }
|
inline fun Int.bar(f: (Int) -> Unit) { }
|
||||||
|
|
||||||
fun test() {
|
fun test() {
|
||||||
1.bar foo@ { if (it == 2) return@<caret>foo }
|
1.bar foo@{ if (it == 2) return@foo }
|
||||||
}
|
}
|
||||||
@@ -3,5 +3,5 @@
|
|||||||
inline fun Int.bar(f: (Int) -> Unit) { }
|
inline fun Int.bar(f: (Int) -> Unit) { }
|
||||||
|
|
||||||
fun test() {
|
fun test() {
|
||||||
1.bar foo@ { 2.bar { if (it == 2) return@<caret>foo } }
|
1.bar foo@{ 2.bar { if (it == 2) return@<caret>foo } }
|
||||||
}
|
}
|
||||||
@@ -3,7 +3,7 @@
|
|||||||
fun run(block: () -> Unit) = block()
|
fun run(block: () -> Unit) = block()
|
||||||
|
|
||||||
fun foo() {
|
fun foo() {
|
||||||
run label@ {
|
run label@{
|
||||||
return@label
|
return@label
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
fun <R> foo(f: () -> R) = f()
|
fun <R> foo(f: () -> R) = f()
|
||||||
|
|
||||||
fun test() {
|
fun test() {
|
||||||
foo baz@ { return@baz false }
|
foo baz@{ return@baz false }
|
||||||
}
|
}
|
||||||
@@ -1,5 +1,5 @@
|
|||||||
fun <R> foo(f: () -> R) = f()
|
fun <R> foo(f: () -> R) = f()
|
||||||
|
|
||||||
fun test() {
|
fun test() {
|
||||||
foo baz@ { return@baz false }
|
foo baz@{ return@baz false }
|
||||||
}
|
}
|
||||||
+1
-1
@@ -1,5 +1,5 @@
|
|||||||
fun <R> foo(f: () -> R) = f()
|
fun <R> foo(f: () -> R) = f()
|
||||||
|
|
||||||
fun test() {
|
fun test() {
|
||||||
foo (baz@ { return@baz false })
|
foo (baz@{ return@baz false })
|
||||||
}
|
}
|
||||||
+1
-1
@@ -1,5 +1,5 @@
|
|||||||
fun <R> foo(f: () -> R) = f()
|
fun <R> foo(f: () -> R) = f()
|
||||||
|
|
||||||
fun test() {
|
fun test() {
|
||||||
foo baz@ { return@baz false }
|
foo baz@{ return@baz false }
|
||||||
}
|
}
|
||||||
+1
-1
@@ -1,5 +1,5 @@
|
|||||||
fun <R> foo(f: () -> R) = f()
|
fun <R> foo(f: () -> R) = f()
|
||||||
|
|
||||||
fun test() {
|
fun test() {
|
||||||
foo (bar2@ baz@ { return@baz false })
|
foo (bar2@ baz@{ return@baz false })
|
||||||
}
|
}
|
||||||
Reference in New Issue
Block a user