mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-04-19 13:02:30 +07:00
refix IDEA-55859 Invalid autocomplete suggestion on double Ctrl+Shift+Space
This commit is contained in:
@@ -96,6 +96,21 @@ public class ReferenceExpressionCompletionContributor {
|
||||
));
|
||||
}
|
||||
|
||||
final PsiForeachStatement foreach = PsiTreeUtil.getParentOfType(element, PsiForeachStatement.class);
|
||||
if (foreach != null && !PsiTreeUtil.isAncestor(foreach.getBody(), element, false)) {
|
||||
return new ElementExtractorFilter(new ElementFilter() {
|
||||
@Override
|
||||
public boolean isAcceptable(Object element, @Nullable PsiElement context) {
|
||||
return element != foreach.getIterationParameter();
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isClassAcceptable(Class hintClass) {
|
||||
return true;
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
if (!allowRecursion) {
|
||||
final ElementFilter filter = RecursionWeigher.recursionFilter(element);
|
||||
if (filter != null) {
|
||||
|
||||
@@ -949,7 +949,7 @@ public class SmartTypeCompletionTest extends LightFixtureCompletionTestCase {
|
||||
|
||||
public void testEmptyListWithCollectionsPrefix() throws Throwable { doItemTest(); }
|
||||
|
||||
public void _testForeachLoopVariableInIterableExpression() throws Throwable { doAntiTest(); }
|
||||
public void testForeachLoopVariableInIterableExpression() throws Throwable { doAntiTest(); }
|
||||
|
||||
public void testStaticallyImportedMagicMethod() throws Throwable {
|
||||
configureByTestName();
|
||||
|
||||
Reference in New Issue
Block a user