KT-13113: Add inspection to detect single-expression string template

(cherry picked from squashed commits 49a3ef3 and 4c7a42a)
This commit is contained in:
shiraji
2016-07-29 06:54:36 +03:00
committed by Mikhail Glukhikh
parent a9ee10a8b7
commit 9b8c55d823
18 changed files with 170 additions and 0 deletions
@@ -0,0 +1 @@
org.jetbrains.kotlin.idea.intentions.RemoveSingleExpressionStringTemplateIntention
@@ -0,0 +1,3 @@
// IS_APPLICABLE: FALSE
val bar = <caret>""
@@ -0,0 +1,3 @@
// IS_APPLICABLE: FALSE
val bar = <caret>"Hello"
@@ -0,0 +1,4 @@
// IS_APPLICABLE: FALSE
val foo = "foo"
val bar = <caret>"$foo$foo"
@@ -0,0 +1,4 @@
// INTENTION_TEXT: Remove single-expression string template
val foo = "foo"
val bar = <caret>"$foo"
@@ -0,0 +1,4 @@
// INTENTION_TEXT: Remove single-expression string template
val foo = "foo"
val bar = foo
@@ -0,0 +1,3 @@
// INTENTION_TEXT: Remove single-expression string template
val bar = <caret>"${1.hashCode().toString()}"
@@ -0,0 +1,3 @@
// INTENTION_TEXT: Remove single-expression string template
val bar = 1.hashCode().toString()
@@ -0,0 +1,3 @@
// INTENTION_TEXT: Remove single-expression string template
val bar = <caret>"${1.hashCode()}"
@@ -0,0 +1,3 @@
// INTENTION_TEXT: Remove single-expression string template
val bar = 1.hashCode().toString()
@@ -0,0 +1,4 @@
// IS_APPLICABLE: FALSE
val foo = "foo"
val bar = <caret>"text$foo"