mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-04-19 04:51:24 +07:00
don't suggest break/continue inside lambda/anonymous inside a loop (IDEA-CR-10869)
This commit is contained in:
@@ -652,7 +652,7 @@ public class JavaKeywordCompletion {
|
||||
}
|
||||
|
||||
private static void addBreakContinue(Consumer<LookupElement> result, PsiElement position) {
|
||||
PsiLoopStatement loop = PsiTreeUtil.getParentOfType(position, PsiLoopStatement.class);
|
||||
PsiLoopStatement loop = PsiTreeUtil.getParentOfType(position, PsiLoopStatement.class, true, PsiLambdaExpression.class, PsiMember.class);
|
||||
|
||||
LookupElement br = createKeyword(position, PsiKeyword.BREAK);
|
||||
LookupElement cont = createKeyword(position, PsiKeyword.CONTINUE);
|
||||
|
||||
@@ -0,0 +1,9 @@
|
||||
public class Util {
|
||||
void foo(int a, int b) {
|
||||
Outer: for (int i = 0; i < 239; i++) {
|
||||
Runnable r = () -> {
|
||||
conti<caret>
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -252,4 +252,5 @@ class Test88 {
|
||||
public void testUnexpectedLambdaInAmbiguousCall() { doAntiTest() }
|
||||
|
||||
public void testNoCollectorsInComment() { doAntiTest() }
|
||||
public void testNoContinueInsideLambdaInLoop() { doAntiTest(); }
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user