mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-04-19 04:51:24 +07:00
[java] TextBlockJoinLinesHandler: convert '\s' to ' ' when converting to regular string
GitOrigin-RevId: 5bcd1fb600f5d9a12286147582b4e70726c3835a
This commit is contained in:
committed by
intellij-monorepo-bot
parent
07406d6d08
commit
775db0701c
@@ -103,7 +103,12 @@ public final class TextBlockJoinLinesHandler implements JoinRawLinesHandlerDeleg
|
||||
}
|
||||
int nextI = PsiLiteralUtil.parseBackSlash(literal, i);
|
||||
if (nextI != -1) {
|
||||
if (sb != null) {
|
||||
if (nextI == i + 1 && literal.charAt(nextI) == 's') {
|
||||
if (sb == null) {
|
||||
sb = new StringBuilder(literal.substring(3, i));
|
||||
}
|
||||
sb.append(' ');
|
||||
} else if (sb != null) {
|
||||
sb.append(literal, i + 1, nextI + 1);
|
||||
}
|
||||
//noinspection AssignmentToForLoopParameter
|
||||
|
||||
@@ -0,0 +1,6 @@
|
||||
class A {
|
||||
void test() {
|
||||
String s = STR."""<caret>
|
||||
Hello\s""";
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,5 @@
|
||||
class A {
|
||||
void test() {
|
||||
String s = STR."Hello ";
|
||||
}
|
||||
}
|
||||
@@ -315,6 +315,7 @@ public class JoinLinesTest extends LightJavaCodeInsightTestCase {
|
||||
public void testJoinTextBlockSlashSFake() {doTest();}
|
||||
public void testJoinTextBlockSlashS2() {doTest();}
|
||||
public void testJoinTextBlockSlashSComplete() {doTest();}
|
||||
public void testJoinTextBlockSlashSAtTheEnd() {doTest();}
|
||||
public void testJoinStringTemplateBackSlash() {doTest();}
|
||||
public void testJoinStringTemplateBackSlash2() {doTest();}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user