mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
disable test navigation outside test roots
This commit is contained in:
+5
@@ -29,6 +29,7 @@ import com.intellij.openapi.roots.ProjectRootManager;
|
||||
import com.intellij.openapi.vfs.VfsUtil;
|
||||
import com.intellij.openapi.vfs.VirtualFile;
|
||||
import com.intellij.psi.*;
|
||||
import com.intellij.psi.util.PsiUtilCore;
|
||||
import com.intellij.util.PlatformIcons;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
import org.jetbrains.annotations.Nullable;
|
||||
@@ -51,6 +52,10 @@ public class TestDataLineMarkerProvider implements LineMarkerProvider {
|
||||
if (ApplicationManager.getApplication().isUnitTestMode()) {
|
||||
return null;
|
||||
}
|
||||
final VirtualFile file = PsiUtilCore.getVirtualFile(element);
|
||||
if (file == null || !ProjectFileIndex.SERVICE.getInstance(element.getProject()).isInTestSourceContent(file)) {
|
||||
return null;
|
||||
}
|
||||
if (element instanceof PsiMethod) {
|
||||
final PsiMethod method = (PsiMethod)element;
|
||||
if (isTestMethod(method)) {
|
||||
|
||||
Reference in New Issue
Block a user