mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
[java] drops value break keyword completion
GitOrigin-RevId: b713ae661f06245ae400d6aa20ec14d2fa2f20ef
This commit is contained in:
committed by
intellij-monorepo-bot
parent
60e3e2280b
commit
1baaa93702
@@ -773,13 +773,9 @@ public class JavaKeywordCompletion {
|
||||
if (psiElement().inside(PsiSwitchStatement.class).accepts(myPosition)) {
|
||||
addKeyword(br);
|
||||
}
|
||||
else if (psiElement().inside(PsiSwitchExpression.class).accepts(myPosition)) {
|
||||
if (PsiUtil.getLanguageLevel(myPosition) == LanguageLevel.JDK_12_PREVIEW) {
|
||||
addKeyword(TailTypeDecorator.withTail(createKeyword(PsiKeyword.BREAK), TailType.INSERT_SPACE));
|
||||
}
|
||||
else if (PsiUtil.getLanguageLevel(myPosition).isAtLeast(LanguageLevel.JDK_13_PREVIEW)) {
|
||||
addKeyword(TailTypeDecorator.withTail(createKeyword(PsiKeyword.YIELD), TailType.INSERT_SPACE));
|
||||
}
|
||||
else if (psiElement().inside(PsiSwitchExpression.class).accepts(myPosition) &&
|
||||
PsiUtil.getLanguageLevel(myPosition).isAtLeast(LanguageLevel.JDK_13_PREVIEW)) {
|
||||
addKeyword(TailTypeDecorator.withTail(createKeyword(PsiKeyword.YIELD), TailType.INSERT_SPACE));
|
||||
}
|
||||
|
||||
for (PsiLabeledStatement labeled : psiApi().parents(myPosition).takeWhile(notInstanceOf(PsiMember.class)).filter(PsiLabeledStatement.class)) {
|
||||
|
||||
+12
@@ -0,0 +1,12 @@
|
||||
class BreakDeepInsideSwitchExpression {
|
||||
int test(int i) {
|
||||
return switch (i) {
|
||||
default -> {
|
||||
while (true) {
|
||||
if (--i < 8) br<caret>
|
||||
}
|
||||
yield i;
|
||||
};
|
||||
};
|
||||
}
|
||||
}
|
||||
+12
@@ -0,0 +1,12 @@
|
||||
class BreakDeepInsideSwitchExpression {
|
||||
int test(int i) {
|
||||
return switch (i) {
|
||||
default -> {
|
||||
while (true) {
|
||||
if (--i < 8) break;
|
||||
}
|
||||
yield i;
|
||||
};
|
||||
};
|
||||
}
|
||||
}
|
||||
+1
@@ -21,4 +21,5 @@ class Normal13CompletionTest extends NormalCompletionTestCase {
|
||||
void testYieldInSwitchExpression() { doTest() }
|
||||
void testInsideYieldInSwitchExpression() { doTest() }
|
||||
void testInsideRuleInSwitchExpression() { doTest() }
|
||||
void testBreakDeepInsideSwitchExpression() { doTest() }
|
||||
}
|
||||
Reference in New Issue
Block a user