KT-13113: Add inspection to detect single-expression string template
(cherry picked from squashed commits 49a3ef3 and 4c7a42a)
This commit is contained in:
committed by
Mikhail Glukhikh
parent
a9ee10a8b7
commit
9b8c55d823
@@ -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"
|
||||
+4
@@ -0,0 +1,4 @@
|
||||
// IS_APPLICABLE: FALSE
|
||||
|
||||
val foo = "foo"
|
||||
val bar = <caret>"$foo$foo"
|
||||
Vendored
+4
@@ -0,0 +1,4 @@
|
||||
// INTENTION_TEXT: Remove single-expression string template
|
||||
|
||||
val foo = "foo"
|
||||
val bar = <caret>"$foo"
|
||||
+4
@@ -0,0 +1,4 @@
|
||||
// INTENTION_TEXT: Remove single-expression string template
|
||||
|
||||
val foo = "foo"
|
||||
val bar = foo
|
||||
+3
@@ -0,0 +1,3 @@
|
||||
// INTENTION_TEXT: Remove single-expression string template
|
||||
|
||||
val bar = <caret>"${1.hashCode().toString()}"
|
||||
+3
@@ -0,0 +1,3 @@
|
||||
// INTENTION_TEXT: Remove single-expression string template
|
||||
|
||||
val bar = 1.hashCode().toString()
|
||||
+3
@@ -0,0 +1,3 @@
|
||||
// INTENTION_TEXT: Remove single-expression string template
|
||||
|
||||
val bar = <caret>"${1.hashCode()}"
|
||||
+3
@@ -0,0 +1,3 @@
|
||||
// INTENTION_TEXT: Remove single-expression string template
|
||||
|
||||
val bar = 1.hashCode().toString()
|
||||
+4
@@ -0,0 +1,4 @@
|
||||
// IS_APPLICABLE: FALSE
|
||||
|
||||
val foo = "foo"
|
||||
val bar = <caret>"text$foo"
|
||||
Reference in New Issue
Block a user