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
@@ -1,4 +1,4 @@
// IS_APPLICABLE: false
// PROBLEM: none
fun foo() {
val x = "x"
val y = "$<caret>{x.length}"
@@ -1,4 +1,4 @@
// IS_APPLICABLE: false
// PROBLEM: none
fun foo() {
val x = X()
val y = "$<caret>{x.bar()}"
@@ -1,4 +1,4 @@
// IS_APPLICABLE: false
// PROBLEM: none
fun foo() {
val x = 3
val z = 4
@@ -1,4 +1,4 @@
// IS_APPLICABLE: false
// PROBLEM: none
fun foo() {
val x = 3
val y = "$<caret>{x}y"
@@ -1,4 +1,4 @@
// IS_APPLICABLE: false
// PROBLEM: none
fun foo() {
val x = 3
val y = "$<caret>{x}_y"
@@ -1,4 +1,4 @@
// IS_APPLICABLE: false
// PROBLEM: none
fun foo() {
val x = 3
val y = "$<caret>{x}コトリン"
@@ -1,4 +1,4 @@
// IS_APPLICABLE: true
fun foo() {
val x = 4
val y = "$<caret>{x}"
@@ -1,4 +1,4 @@
// IS_APPLICABLE: true
fun foo() {
val x = 4
val y = "$<caret>{x}.moretext"
@@ -1,4 +1,4 @@
// IS_APPLICABLE: true
fun foo() {
val x = 4
val y = "$<caret>x.moretext"
@@ -1,4 +1,4 @@
// IS_APPLICABLE: true
fun foo() {
val x = 4
val y = "$<caret>{x}\n"
@@ -1,4 +1,4 @@
// IS_APPLICABLE: true
fun foo() {
val x = 4
val y = "$<caret>{x}() this is okay, x will not be thought of as a function call"
@@ -1,4 +1,4 @@
// IS_APPLICABLE: true
fun foo() {
val x = 4
val y = "$x() this is okay, x will not be thought of as a function call"
@@ -1,4 +1,4 @@
// IS_APPLICABLE: true
fun foo() {
val x = 4
val y = "text$<caret>{x} moretext"
@@ -1,4 +1,4 @@
// IS_APPLICABLE: true
fun foo() {
val x = 4
val y = "text$x moretext"
@@ -1,4 +1,4 @@
// IS_APPLICABLE: true
fun foo() {
val x = 4
val y = """text$<caret>{x} moretext"""
@@ -1,4 +1,4 @@
// IS_APPLICABLE: true
fun foo() {
val x = 4
val y = """text$x moretext"""
@@ -1,4 +1,4 @@
// IS_APPLICABLE: true
fun foo(`object`: Any) {
val bar = "$<caret>{`object`}"
}
@@ -1,4 +1,4 @@
// IS_APPLICABLE: true
fun foo(`object`: Any) {
val bar = "$`object`"
}
@@ -1 +0,0 @@
org.jetbrains.kotlin.idea.intentions.RemoveCurlyBracesFromTemplateIntention