mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
[java] text blocks: skipping opening whitespaces (IDEA-215312)
GitOrigin-RevId: 8561a8ac4a415146a8e971937a99a9900df41401
This commit is contained in:
committed by
intellij-monorepo-bot
parent
29ae5908d7
commit
ab07305151
+4
-4
@@ -1146,15 +1146,15 @@ public class HighlightUtil extends HighlightUtilBase {
|
||||
}
|
||||
else if (type == JavaTokenType.TEXT_BLOCK_LITERAL) {
|
||||
if (value == null) {
|
||||
if (text.charAt(3) != '\n') {
|
||||
String message = JavaErrorMessages.message("text.block.new.line");
|
||||
return HighlightInfo.newHighlightInfo(HighlightInfoType.ERROR).range(expression).descriptionAndTooltip(message).create();
|
||||
}
|
||||
if (!text.endsWith("\"\"\"")) {
|
||||
String message = JavaErrorMessages.message("text.block.unclosed");
|
||||
int p = expression.getTextRange().getEndOffset();
|
||||
return HighlightInfo.newHighlightInfo(HighlightInfoType.ERROR).range(p, p).endOfLine().descriptionAndTooltip(message).create();
|
||||
}
|
||||
else {
|
||||
String message = JavaErrorMessages.message("text.block.new.line");
|
||||
return HighlightInfo.newHighlightInfo(HighlightInfoType.ERROR).range(expression).descriptionAndTooltip(message).create();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
+5
@@ -11,6 +11,11 @@ class LightJava13HighlightingTest : LightCodeInsightFixtureTestCase() {
|
||||
fun testTextBlocks() = doTest()
|
||||
fun testUnclosedTextBlock() = doTest()
|
||||
|
||||
fun testTextBlockOpeningSpaces() {
|
||||
myFixture.configureByText(getTestName(false) + ".java", "class C {\n String spaces = \"\"\" \t \u000C \n \"\"\";\n}")
|
||||
myFixture.checkHighlighting()
|
||||
}
|
||||
|
||||
private fun doTest() {
|
||||
myFixture.configureByFile(getTestName(false) + ".java")
|
||||
myFixture.checkHighlighting()
|
||||
|
||||
Reference in New Issue
Block a user