Convert RemoveCurlyBracesFromTemplateIntention to inspection

Relates to #KT-31717
This commit is contained in:
Dmitry Gridin
2019-06-03 11:42:43 +07:00
parent 7f4d2891e8
commit 7bc2fcd657
31 changed files with 129 additions and 159 deletions
@@ -0,0 +1 @@
org.jetbrains.kotlin.idea.inspections.RemoveCurlyBracesFromTemplateInspection
@@ -0,0 +1,5 @@
// PROBLEM: none
fun foo() {
val x = "x"
val y = "$<caret>{x.length}"
}
@@ -0,0 +1,9 @@
// PROBLEM: none
fun foo() {
val x = X()
val y = "$<caret>{x.bar()}"
}
public class X() {
fun bar() : String = "bar"
}
@@ -0,0 +1,6 @@
// PROBLEM: none
fun foo() {
val x = 3
val z = 4
val y = "$<caret>{x + z}"
}
@@ -0,0 +1,5 @@
// PROBLEM: none
fun foo() {
val x = 3
val y = "$<caret>{x}y"
}
@@ -0,0 +1,5 @@
// PROBLEM: none
fun foo() {
val x = 3
val y = "$<caret>{x}_y"
}
@@ -0,0 +1,5 @@
// PROBLEM: none
fun foo() {
val x = 3
val y = "$<caret>{x}コトリン"
}
@@ -0,0 +1,5 @@
fun foo() {
val x = 4
val y = "$<caret>{x}"
}
@@ -0,0 +1,5 @@
fun foo() {
val x = 4
val y = "$x"
}
@@ -0,0 +1,5 @@
fun foo() {
val x = 4
val y = "$<caret>{x}.moretext"
}
@@ -0,0 +1,5 @@
fun foo() {
val x = 4
val y = "$<caret>x.moretext"
}
@@ -0,0 +1,5 @@
fun foo() {
val x = 4
val y = "$<caret>{x}\n"
}
@@ -0,0 +1,5 @@
fun foo() {
val x = 4
val y = "$x\n"
}
@@ -0,0 +1,5 @@
fun foo() {
val x = 4
val y = "$<caret>{x}() this is okay, x will not be thought of as a function call"
}
@@ -0,0 +1,5 @@
fun foo() {
val x = 4
val y = "$x() this is okay, x will not be thought of as a function call"
}
@@ -0,0 +1,5 @@
fun foo() {
val x = 4
val y = "text$<caret>{x} moretext"
}
@@ -0,0 +1,5 @@
fun foo() {
val x = 4
val y = "text$x moretext"
}
@@ -0,0 +1,5 @@
fun foo() {
val x = 4
val y = """text$<caret>{x} moretext"""
}
@@ -0,0 +1,5 @@
fun foo() {
val x = 4
val y = """text$x moretext"""
}
@@ -0,0 +1,4 @@
fun foo(`object`: Any) {
val bar = "$<caret>{`object`}"
}
@@ -0,0 +1,4 @@
fun foo(`object`: Any) {
val bar = "$`object`"
}