mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
disable create test action outside source roots (IDEA-172993)
This commit is contained in:
@@ -86,10 +86,10 @@ public class CreateTestAction extends PsiElementBaseIntentionAction {
|
||||
|
||||
PsiClass psiClass = getContainingClass(element);
|
||||
|
||||
if (psiClass == null || element.getContainingFile().getContainingDirectory() == null) return false;
|
||||
if (psiClass == null) return false;
|
||||
|
||||
Module srcModule = ModuleUtilCore.findModuleForPsiElement(psiClass);
|
||||
if (srcModule == null) return false;
|
||||
PsiFile file = psiClass.getContainingFile();
|
||||
if (file.getContainingDirectory() == null || JavaProjectRootsUtil.isOutsideJavaSourceRoot(file)) return false;
|
||||
|
||||
if (psiClass.isAnnotationType() ||
|
||||
psiClass instanceof PsiAnonymousClass) {
|
||||
|
||||
Reference in New Issue
Block a user