mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-05-06 05:10:22 +07:00
java: disable AddOnDemandStaticImportAction on broken code where it'd break stub-text consistency otherwise
GitOrigin-RevId: 705892a1471eff7797a1fe2abfcbd320849dd76e
This commit is contained in:
committed by
intellij-monorepo-bot
parent
74fb322770
commit
457c7b42b6
@@ -15,6 +15,7 @@ import com.intellij.openapi.wm.WindowManager;
|
||||
import com.intellij.psi.*;
|
||||
import com.intellij.psi.util.PsiTreeUtil;
|
||||
import com.intellij.psi.util.PsiUtil;
|
||||
import com.intellij.psi.util.PsiUtilCore;
|
||||
import com.intellij.refactoring.RefactoringBundle;
|
||||
import com.intellij.util.IncorrectOperationException;
|
||||
import com.siyeh.ig.psiutils.ClassUtils;
|
||||
@@ -58,6 +59,10 @@ public class AddOnDemandStaticImportAction extends BaseElementAtCaretIntentionAc
|
||||
if (!(gParent instanceof PsiJavaCodeReferenceElement) ||
|
||||
isParameterizedReference((PsiJavaCodeReferenceElement)gParent)) return null;
|
||||
|
||||
if (PsiUtilCore.getElementType(PsiTreeUtil.nextCodeLeaf(gParent)) == JavaTokenType.ARROW) {
|
||||
return null;
|
||||
}
|
||||
|
||||
PsiElement resolved = refExpr.resolve();
|
||||
if (!(resolved instanceof PsiClass)) {
|
||||
return null;
|
||||
|
||||
@@ -0,0 +1,10 @@
|
||||
// "Add on-demand static import for 'test.Bar'" "false"
|
||||
package test;
|
||||
|
||||
class Bar {
|
||||
{
|
||||
SomeLambda l =
|
||||
Ba<caret>r.param -> ();
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user