mark "main" method only

This commit is contained in:
Dmitry Avdeev
2015-06-10 11:58:56 +03:00
parent 45d53038e1
commit c2cb84abfa
2 changed files with 36 additions and 1 deletions
@@ -38,7 +38,7 @@ public class ApplicationRunLineMarkerProvider implements LineMarkerProvider {
public LineMarkerInfo getLineMarkerInfo(@NotNull PsiElement element) {
if (element instanceof PsiClass && PsiMethodUtil.findMainInClass((PsiClass)element) != null)
return new RunLineMarkerInfo(element, ApplicationConfigurationType.getInstance().getIcon(), null);
if (element instanceof PsiMethod && PsiMethodUtil.isMainMethod((PsiMethod)element))
if (element instanceof PsiMethod && "main".equals(((PsiMethod)element).getName()) && PsiMethodUtil.isMainMethod((PsiMethod)element))
return new RunLineMarkerInfo(element, ApplicationConfigurationType.getInstance().getIcon(), null);
return null;
}