mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
fix test line markers
This commit is contained in:
+11
-15
@@ -39,6 +39,17 @@ import java.util.List;
|
||||
*/
|
||||
public class TestDataLineMarkerProvider implements LineMarkerProvider {
|
||||
public LineMarkerInfo getLineMarkerInfo(PsiElement element) {
|
||||
if (ApplicationManager.getApplication().isUnitTestMode()) {
|
||||
return null;
|
||||
}
|
||||
if (element instanceof PsiMethod) {
|
||||
final PsiMethod method = (PsiMethod)element;
|
||||
if (isTestMethod(method)) {
|
||||
return new LineMarkerInfo<PsiMethod>(
|
||||
method, method.getModifierList().getTextRange(), PlatformIcons.TEST_SOURCE_FOLDER, Pass.UPDATE_ALL, null, new TestDataNavigationHandler(),
|
||||
GutterIconRenderer.Alignment.LEFT);
|
||||
}
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
@@ -65,21 +76,6 @@ public class TestDataLineMarkerProvider implements LineMarkerProvider {
|
||||
}
|
||||
|
||||
public void collectSlowLineMarkers(List<PsiElement> elements, Collection<LineMarkerInfo> result) {
|
||||
if (ApplicationManager.getApplication().isUnitTestMode()) {
|
||||
return;
|
||||
}
|
||||
for (PsiElement element : elements) {
|
||||
if (!(element instanceof PsiMethod)) {
|
||||
continue;
|
||||
}
|
||||
final PsiMethod method = (PsiMethod)element;
|
||||
if (isTestMethod(method)) {
|
||||
result.add(new LineMarkerInfo<PsiMethod>(
|
||||
method, method.getTextRange(), PlatformIcons.TEST_SOURCE_FOLDER, Pass.UPDATE_ALL, null, new TestDataNavigationHandler(),
|
||||
GutterIconRenderer.Alignment.LEFT
|
||||
));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@Nullable
|
||||
|
||||
Reference in New Issue
Block a user