mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
java: keep text blocks escapes as separate feature
GitOrigin-RevId: 086115a4a13b983c6a9f116253634fd15dab612e
This commit is contained in:
committed by
intellij-monorepo-bot
parent
97d8494221
commit
bb49afba0d
@@ -109,6 +109,7 @@ feature.modules=Modules
|
||||
feature.lvti=Local variable type inference
|
||||
feature.var.lambda.parameter='var' in lambda parameters
|
||||
feature.text.blocks=Text block literals
|
||||
feature.text.block.escape.sequences='\\s' and '\\' escape sequences
|
||||
feature.enhanced.switch=Enhanced 'switch' blocks
|
||||
feature.switch.expressions='switch' expressions
|
||||
feature.records=Records
|
||||
|
||||
+2
-2
@@ -1218,13 +1218,13 @@ public class HighlightUtil {
|
||||
}
|
||||
else {
|
||||
if (file != null && containsUnescaped(text, "\\\n")) {
|
||||
final HighlightInfo info = checkFeature(expression, HighlightingFeature.TEXT_BLOCKS, level, file);
|
||||
final HighlightInfo info = checkFeature(expression, HighlightingFeature.TEXT_BLOCK_ESCAPES, level, file);
|
||||
if (info != null) return info;
|
||||
}
|
||||
}
|
||||
}
|
||||
if (file != null && containsUnescaped(text, "\\s")) {
|
||||
final HighlightInfo info = checkFeature(expression, HighlightingFeature.TEXT_BLOCKS, level, file);
|
||||
final HighlightInfo info = checkFeature(expression, HighlightingFeature.TEXT_BLOCK_ESCAPES, level, file);
|
||||
if (info != null) return info;
|
||||
}
|
||||
}
|
||||
|
||||
+1
@@ -36,6 +36,7 @@ public enum HighlightingFeature {
|
||||
SWITCH_EXPRESSION(LanguageLevel.JDK_14, "feature.switch.expressions"),
|
||||
RECORDS(LanguageLevel.JDK_14_PREVIEW, "feature.records"),
|
||||
PATTERNS(LanguageLevel.JDK_14_PREVIEW, "feature.patterns.instanceof"),
|
||||
TEXT_BLOCK_ESCAPES(LanguageLevel.JDK_14_PREVIEW, "feature.text.block.escape.sequences"),
|
||||
TEXT_BLOCKS(LanguageLevel.JDK_14_PREVIEW, "feature.text.blocks") {
|
||||
@Override
|
||||
boolean isSufficient(@NotNull LanguageLevel useSiteLevel) {
|
||||
|
||||
+1
-1
@@ -23,6 +23,6 @@ class UnsupportedFeatures {
|
||||
|
||||
String raw = <error descr="Text block literals are not supported at language level '1.4'">"""hi there"""</error>;
|
||||
|
||||
String spaceEscapeSeq = <error descr="Text block literals are not supported at language level '1.4'">"\s"</error>;
|
||||
String spaceEscapeSeq = <error descr="'\s' and '\' escape sequences are not supported at language level '1.4'">"\s"</error>;
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user