2 Intentions for string templates:

the first removes curly braces from a simple name variable, ${x} -> $x
and the second does the opposite $x -> ${x}
This commit is contained in:
Tal Man
2014-02-08 19:20:25 -05:00
committed by Andrey Breslav
parent 559ea28a6b
commit 89779b5013
41 changed files with 342 additions and 6 deletions
@@ -0,0 +1,5 @@
// IS_APPLICABLE: false
fun foo() {
val x = 4
val y = "<caret>hello"
}
@@ -0,0 +1,5 @@
// IS_APPLICABLE: true
fun foo() {
val x = 4
val y = "$<caret>x"
}
@@ -0,0 +1,5 @@
// IS_APPLICABLE: true
fun foo() {
val x = 4
val y = "${x}"
}
@@ -0,0 +1,5 @@
// IS_APPLICABLE: true
fun foo() {
val x = 4
val y = "something$<caret>x.somethingelse"
}
@@ -0,0 +1,5 @@
// IS_APPLICABLE: true
fun foo() {
val x = 4
val y = "something${x}.somethingelse"
}
@@ -0,0 +1,5 @@
// IS_APPLICABLE: true
fun foo() {
val x = 4
val y = "$<caret>x\n"
}
@@ -0,0 +1,5 @@
// IS_APPLICABLE: true
fun foo() {
val x = 4
val y = "${x}\n"
}
@@ -0,0 +1,5 @@
// IS_APPLICABLE: true
fun foo() {
val x = 4
val y = "$x$<caret>x$x"
}
@@ -0,0 +1,5 @@
// IS_APPLICABLE: true
fun foo() {
val x = 4
val y = "$x${x}$x"
}
@@ -0,0 +1,5 @@
// IS_APPLICABLE: true
fun foo() {
val x = 4
val y = """$x$<caret>x$x"""
}
@@ -0,0 +1,5 @@
// IS_APPLICABLE: true
fun foo() {
val x = 4
val y = """$x${x}$x"""
}