mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 06:05:01 +07:00
provide scope to detect location more precisely (IDEA-107895)
This commit is contained in:
+3
-2
@@ -25,6 +25,7 @@ import com.intellij.execution.testframework.JavaAwareFilter;
|
||||
import com.intellij.execution.testframework.actions.AbstractRerunFailedTestsAction;
|
||||
import com.intellij.openapi.project.Project;
|
||||
import com.intellij.openapi.ui.ComponentContainer;
|
||||
import com.intellij.psi.search.GlobalSearchScope;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
|
||||
public class JavaRerunFailedTestsAction extends AbstractRerunFailedTestsAction {
|
||||
@@ -35,8 +36,8 @@ public class JavaRerunFailedTestsAction extends AbstractRerunFailedTestsAction {
|
||||
|
||||
@NotNull
|
||||
@Override
|
||||
protected Filter getFilter(Project project) {
|
||||
return Filter.FAILED_OR_INTERRUPTED.and(JavaAwareFilter.METHOD(project));
|
||||
protected Filter getFilter(Project project, GlobalSearchScope searchScope) {
|
||||
return Filter.FAILED_OR_INTERRUPTED.and(JavaAwareFilter.METHOD(project, searchScope));
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -25,15 +25,16 @@ import com.intellij.execution.PsiLocation;
|
||||
import com.intellij.execution.junit2.info.MethodLocation;
|
||||
import com.intellij.openapi.project.Project;
|
||||
import com.intellij.psi.PsiMethod;
|
||||
import com.intellij.psi.search.GlobalSearchScope;
|
||||
|
||||
public class JavaAwareFilter {
|
||||
private JavaAwareFilter() {
|
||||
}
|
||||
|
||||
public static Filter METHOD(final Project project) {
|
||||
public static Filter METHOD(final Project project, final GlobalSearchScope searchScope) {
|
||||
return new Filter() {
|
||||
public boolean shouldAccept(final AbstractTestProxy test) {
|
||||
final Location location = test.getLocation(project);
|
||||
final Location location = test.getLocation(project, searchScope);
|
||||
if (location instanceof MethodLocation) return true;
|
||||
if (location instanceof PsiLocation && location.getPsiElement() instanceof PsiMethod) return true;
|
||||
return false;
|
||||
|
||||
Reference in New Issue
Block a user