mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-18 09:34:34 +07:00
disable on-demand static import inside import statements (IDEA-196022)
This commit is contained in:
+1
-1
@@ -61,7 +61,7 @@ public class AddOnDemandStaticImportAction extends BaseElementAtCaretIntentionAc
|
||||
if (!(element instanceof PsiIdentifier) || !(element.getParent() instanceof PsiJavaCodeReferenceElement)) {
|
||||
return null;
|
||||
}
|
||||
if (PsiTreeUtil.getParentOfType(element, PsiErrorElement.class) != null) return null;
|
||||
if (PsiTreeUtil.getParentOfType(element, PsiErrorElement.class, PsiImportStatementBase.class) != null) return null;
|
||||
PsiJavaCodeReferenceElement refExpr = (PsiJavaCodeReferenceElement)element.getParent();
|
||||
if (refExpr instanceof PsiMethodReferenceExpression) return null;
|
||||
final PsiElement gParent = refExpr.getParent();
|
||||
|
||||
+8
@@ -0,0 +1,8 @@
|
||||
// "Add on demand static import for 'java.util.Collections'" "false"
|
||||
package test;
|
||||
|
||||
import static java.util.Collections.*;
|
||||
import static java.util.Colle<caret>ctions.emptyList;
|
||||
|
||||
abstract class Foo {
|
||||
}
|
||||
Reference in New Issue
Block a user