KT-31553 Complete Statement: Wrong auto-insertion of closing curly brace for a code block (#2378)
* Complete statement: wrap property initializer by run/when block #KT-31553 Fixed
This commit is contained in:
committed by
GitHub
parent
14bdcb1e26
commit
37ba9eccc4
Vendored
+15
@@ -0,0 +1,15 @@
|
||||
// WITH_RUNTIME
|
||||
fun test(): Int = bar { <caret>foo()
|
||||
|
||||
fun foo() = 42
|
||||
|
||||
fun bar(f: () -> Int) = f()
|
||||
//-----
|
||||
// WITH_RUNTIME
|
||||
fun test(): Int = bar {
|
||||
<caret>foo()
|
||||
}
|
||||
|
||||
fun foo() = 42
|
||||
|
||||
fun bar(f: () -> Int) = f()
|
||||
+11
@@ -0,0 +1,11 @@
|
||||
// WITH_RUNTIME
|
||||
fun test() {
|
||||
val test = run { <caret>1
|
||||
}
|
||||
//-----
|
||||
// WITH_RUNTIME
|
||||
fun test() {
|
||||
val test = run {
|
||||
<caret>1
|
||||
}
|
||||
}
|
||||
+19
@@ -0,0 +1,19 @@
|
||||
// WITH_RUNTIME
|
||||
class Test {
|
||||
val test = run {<caret>foo()
|
||||
|
||||
fun foo(): Int {
|
||||
return 42
|
||||
}
|
||||
}
|
||||
//-----
|
||||
// WITH_RUNTIME
|
||||
class Test {
|
||||
val test = run {
|
||||
<caret>foo()
|
||||
}
|
||||
|
||||
fun foo(): Int {
|
||||
return 42
|
||||
}
|
||||
}
|
||||
+11
@@ -0,0 +1,11 @@
|
||||
// WITH_RUNTIME
|
||||
val test = run {<caret>foo()
|
||||
|
||||
fun foo() = 42
|
||||
//-----
|
||||
// WITH_RUNTIME
|
||||
val test = run {
|
||||
<caret>foo()
|
||||
}
|
||||
|
||||
fun foo() = 42
|
||||
+14
@@ -0,0 +1,14 @@
|
||||
// WITH_RUNTIME
|
||||
fun test(): Int = bar { f<caret>oo()
|
||||
|
||||
fun foo() = 42
|
||||
|
||||
fun bar(f: () -> Int) = f()
|
||||
//-----
|
||||
// WITH_RUNTIME
|
||||
fun test(): Int = bar { f
|
||||
<caret>oo()
|
||||
|
||||
fun foo() = 42
|
||||
|
||||
fun bar(f: () -> Int) = f()
|
||||
Vendored
+9
@@ -0,0 +1,9 @@
|
||||
fun test() {
|
||||
val test = when { <caret>1
|
||||
}
|
||||
//-----
|
||||
fun test() {
|
||||
val test = when {
|
||||
<caret>1
|
||||
}
|
||||
}
|
||||
Vendored
+17
@@ -0,0 +1,17 @@
|
||||
class Test {
|
||||
val test = when {<caret>foo()
|
||||
|
||||
fun foo(): Int {
|
||||
return 42
|
||||
}
|
||||
}
|
||||
//-----
|
||||
class Test {
|
||||
val test = when {
|
||||
<caret>foo()
|
||||
}
|
||||
|
||||
fun foo(): Int {
|
||||
return 42
|
||||
}
|
||||
}
|
||||
Vendored
+9
@@ -0,0 +1,9 @@
|
||||
val test = when {<caret>foo()
|
||||
|
||||
fun foo() = 42
|
||||
//-----
|
||||
val test = when {
|
||||
<caret>foo()
|
||||
}
|
||||
|
||||
fun foo() = 42
|
||||
Reference in New Issue
Block a user