mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-18 09:34:34 +07:00
disable "add on demand static import" on invalid code
This commit is contained in:
+1
@@ -57,6 +57,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;
|
||||
PsiJavaCodeReferenceElement refExpr = (PsiJavaCodeReferenceElement)element.getParent();
|
||||
if (refExpr instanceof PsiMethodReferenceExpression) return null;
|
||||
final PsiElement gParent = refExpr.getParent();
|
||||
|
||||
+10
@@ -0,0 +1,10 @@
|
||||
// "Add on demand static import for 'test.SomeClass'" "false"
|
||||
package test;
|
||||
|
||||
public class SomeClass {
|
||||
SomeC<caret>lass.meClass() {
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user