Info (@NotNull final PsiElement element) { if (!isFromGroovyGradleScript(element)) return null; if (element instanceof LeafElement && !(element instanceof PsiWhiteSpace) && !(element instanceof PsiComment) && element.getParent() instanceof GrReferenceExpression && element.getParent().getParent() instanceof GrMethodCallExpression) { List<String> tasks = GradleGroovyRunnerUtil.getTasksTarget(element); if (!tasks.isEmpty() && tasks.contains(element.getText().trim())) { AnAction[] actions = ExecutorAction.getActions(); AnActionEvent event = createActionEvent(element); return new Info(AllIcons.RunConfigurations.TestState.Run, actions, e -> join(mapNotNull(actions, action -> getText(action, event)), "\n")); } } return null; }