Amend "Terminate preceding call with semicolon" quickfix
Quickfix wasn't aware of cases, when expression to be fixed is a part of parent call expression or dot-qualified expression. Incorrect position for extracting trailing lambdas led to broken formatting. #KT-34694 Fixed
This commit is contained in:
Vendored
+10
@@ -0,0 +1,10 @@
|
||||
// "Terminate preceding call with semicolon" "true"
|
||||
|
||||
fun doSomething() {}
|
||||
fun Any.foo() {}
|
||||
|
||||
fun test() {
|
||||
doSomething().foo()
|
||||
// comment and formatting
|
||||
{ doSomething()<caret> }()
|
||||
}
|
||||
Vendored
+10
@@ -0,0 +1,10 @@
|
||||
// "Terminate preceding call with semicolon" "true"
|
||||
|
||||
fun doSomething() {}
|
||||
fun Any.foo() {}
|
||||
|
||||
fun test() {
|
||||
doSomething().foo();
|
||||
// comment and formatting
|
||||
{ doSomething() }()
|
||||
}
|
||||
@@ -0,0 +1,9 @@
|
||||
// "Terminate preceding call with semicolon" "true"
|
||||
|
||||
fun foo() {}
|
||||
|
||||
fun test {
|
||||
foo()
|
||||
// comment and formatting
|
||||
{ { { foo() }<caret> } }()()()
|
||||
}
|
||||
+9
@@ -0,0 +1,9 @@
|
||||
// "Terminate preceding call with semicolon" "true"
|
||||
|
||||
fun foo() {}
|
||||
|
||||
fun test {
|
||||
foo();
|
||||
// comment and formatting
|
||||
{ { { foo() } } }()()()
|
||||
}
|
||||
@@ -0,0 +1,7 @@
|
||||
// "Terminate preceding call with semicolon" "true"
|
||||
|
||||
fun foo() {
|
||||
15.toString()
|
||||
// comment and formatting
|
||||
{<caret>}
|
||||
}
|
||||
+7
@@ -0,0 +1,7 @@
|
||||
// "Terminate preceding call with semicolon" "true"
|
||||
|
||||
fun foo() {
|
||||
15.toString();
|
||||
// comment and formatting
|
||||
{}
|
||||
}
|
||||
+7
@@ -0,0 +1,7 @@
|
||||
// "Terminate preceding call with semicolon" "true"
|
||||
|
||||
fun foo() {
|
||||
{ "first" }.invoke()
|
||||
// comment and formatting
|
||||
{<caret> "second" }.invoke()
|
||||
}
|
||||
+7
@@ -0,0 +1,7 @@
|
||||
// "Terminate preceding call with semicolon" "true"
|
||||
|
||||
fun foo() {
|
||||
{ "first" }.invoke();
|
||||
// comment and formatting
|
||||
{ "second" }.invoke()
|
||||
}
|
||||
Reference in New Issue
Block a user