preserve text blocks when converting to (message)format string (IDEA-217253, IDEA-218831)

and use new text block escaping

GitOrigin-RevId: cc8eea8aa0c638b967e40b6a6b4b9dea1cfed61d
This commit is contained in:
Bas Leijdekkers
2019-08-02 00:04:00 +03:00
committed by intellij-monorepo-bot
parent f5bd40eb0c
commit a12eee9fbc
10 changed files with 107 additions and 110 deletions
@@ -0,0 +1,5 @@
class C {
private static String quote(String s) {
return java.text.MessageFormat.format("\"{0}\"", s);
}
}
@@ -0,0 +1,5 @@
class C {
private static String quote(String s) {
return '"' + <caret>s + '"';
}
}
@@ -0,0 +1,11 @@
class C {
void x(int a, int b) {
//keep me
String s = java.text.MessageFormat.format("""
the text
block
line2
{0}{1} "to" be""", a, b);
}
}
@@ -0,0 +1,11 @@
class C {
void x(int a, int b) {
String s = """
the text\n block
line2
""" +
a + b + <caret>//keep me
" \"to\" be";
}
}