mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
disable migration to junit 5 if no library is attached (IDEA-163477)
This commit is contained in:
@@ -21,10 +21,7 @@ import com.intellij.codeInspection.*;
|
||||
import com.intellij.codeInspection.actions.CleanupInspectionIntention;
|
||||
import com.intellij.codeInspection.ex.LocalInspectionToolWrapper;
|
||||
import com.intellij.openapi.project.Project;
|
||||
import com.intellij.psi.PsiClass;
|
||||
import com.intellij.psi.PsiField;
|
||||
import com.intellij.psi.PsiFile;
|
||||
import com.intellij.psi.PsiMethod;
|
||||
import com.intellij.psi.*;
|
||||
import com.intellij.psi.search.GlobalSearchScope;
|
||||
import com.intellij.psi.util.PsiTreeUtil;
|
||||
import com.intellij.psi.util.PsiUtil;
|
||||
@@ -68,6 +65,9 @@ public class JUnit5ConverterInspection extends BaseInspection {
|
||||
@Override
|
||||
public boolean shouldInspect(PsiFile file) {
|
||||
if (!PsiUtil.isLanguageLevel8OrHigher(file)) return false;
|
||||
if (JavaPsiFacade.getInstance(file.getProject()).findClass(JUnitCommonClassNames.ORG_JUNIT_JUPITER_API_ASSERTIONS, file.getResolveScope()) == null) {
|
||||
return false;
|
||||
}
|
||||
return super.shouldInspect(file);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user