mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
java: yield/break completion + migrate tests to java 13
GitOrigin-RevId: 229f13e7dd85154e63754f82f4b44bbcbca67a40
This commit is contained in:
committed by
intellij-monorepo-bot
parent
86c773e12a
commit
196b7a83a3
@@ -775,8 +775,9 @@ public class JavaKeywordCompletion {
|
||||
addKeyword(br);
|
||||
}
|
||||
else if (psiElement().inside(PsiSwitchExpression.class).accepts(myPosition)) {
|
||||
addKeyword(TailTypeDecorator.withTail(br, TailType.INSERT_SPACE));
|
||||
addKeyword(TailTypeDecorator.withTail(createKeyword(PsiKeyword.YIELD), TailType.INSERT_SPACE));
|
||||
addKeyword(TailTypeDecorator.withTail(PsiUtil.getLanguageLevel(myPosition) == LanguageLevel.JDK_12_PREVIEW
|
||||
? createKeyword(PsiKeyword.BREAK)
|
||||
: createKeyword(PsiKeyword.YIELD), TailType.INSERT_SPACE));
|
||||
}
|
||||
|
||||
for (PsiLabeledStatement labeled : psiApi().parents(myPosition).takeWhile(notInstanceOf(PsiMember.class)).filter(PsiLabeledStatement.class)) {
|
||||
|
||||
@@ -2,7 +2,7 @@ public class ConstConfig {
|
||||
int test(int x) {
|
||||
return switch (x) {
|
||||
case 1:
|
||||
if (Math.random() > 0.5) br<caret>
|
||||
if (Math.random() > 0.5) yi<caret>
|
||||
};
|
||||
}
|
||||
}
|
||||
+1
-1
@@ -2,7 +2,7 @@ public class ConstConfig {
|
||||
int test(int x) {
|
||||
return switch (x) {
|
||||
case 1:
|
||||
if (Math.random() > 0.5) break <caret>
|
||||
if (Math.random() > 0.5) yield <caret>
|
||||
};
|
||||
}
|
||||
}
|
||||
+2
-2
@@ -3,9 +3,9 @@ public class ConstConfig {
|
||||
Boolean b;
|
||||
if ((b = switch (0) {
|
||||
case 1: {
|
||||
break aaaa<caret>;
|
||||
yield aaaa<caret>;
|
||||
}
|
||||
default: break false;
|
||||
default: yield false;
|
||||
}));
|
||||
}
|
||||
}
|
||||
+2
-2
@@ -3,9 +3,9 @@ public class ConstConfig {
|
||||
Boolean b;
|
||||
if ((b = switch (0) {
|
||||
case 1: {
|
||||
break aaaaaaaa<caret>;
|
||||
yield aaaaaaaa<caret>;
|
||||
}
|
||||
default: break false;
|
||||
default: yield false;
|
||||
}));
|
||||
}
|
||||
}
|
||||
+1
-1
@@ -12,7 +12,7 @@ class Normal12CompletionTest extends NormalCompletionTestCase {
|
||||
@NotNull
|
||||
@Override
|
||||
protected LightProjectDescriptor getProjectDescriptor() {
|
||||
return JAVA_12
|
||||
return JAVA_13
|
||||
}
|
||||
|
||||
void testDefaultInRuleSwitch() throws Throwable { doTest() }
|
||||
|
||||
Reference in New Issue
Block a user