mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-04-20 13:31:28 +07:00
[java-completion] IDEA-356400 Join lines adds \n outside text block literal
GitOrigin-RevId: 8afe6a733da77bb78e42feec646437af62400d23
This commit is contained in:
committed by
intellij-monorepo-bot
parent
d3a058c788
commit
097332e117
@@ -31,6 +31,7 @@ public final class TextBlockJoinLinesHandler implements JoinRawLinesHandlerDeleg
|
||||
!tokenType.equals(JavaTokenType.TEXT_BLOCK_TEMPLATE_MID)) {
|
||||
return CANNOT_JOIN;
|
||||
}
|
||||
if (file.findElementAt(end) != token) return CANNOT_JOIN;
|
||||
TextRange tokenRange = token.getTextRange();
|
||||
int lineNumber = doc.getLineNumber(start);
|
||||
boolean atStartLine = (tokenType.equals(JavaTokenType.TEXT_BLOCK_LITERAL) || tokenType.equals(JavaTokenType.TEXT_BLOCK_TEMPLATE_BEGIN))
|
||||
|
||||
@@ -0,0 +1,7 @@
|
||||
class X {
|
||||
void x() {
|
||||
System.out.println("""
|
||||
some text"""<caret>
|
||||
);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,6 @@
|
||||
class X {
|
||||
void x() {
|
||||
System.out.println("""
|
||||
some text"""<caret>);
|
||||
}
|
||||
}
|
||||
@@ -318,6 +318,7 @@ public class JoinLinesTest extends LightJavaCodeInsightTestCase {
|
||||
public void testJoinTextBlockSlashSAtTheEnd() {doTest();}
|
||||
public void testJoinStringTemplateBackSlash() {doTest();}
|
||||
public void testJoinStringTemplateBackSlash2() {doTest();}
|
||||
public void testJoinOutsideOfTextBlock() { doTest(); }
|
||||
|
||||
private void doTest() {
|
||||
doTest(".java");
|
||||
|
||||
Reference in New Issue
Block a user