use of com.goide.runconfig.testing.GoTestFramework in project go-lang-idea-plugin by go-lang-plugin-org.
the class GoGenerateTestMethodActionGroup method getChildren.
@NotNull
@Override
public AnAction[] getChildren(@Nullable AnActionEvent e) {
if (e == null) {
return AnAction.EMPTY_ARRAY;
}
Project project = e.getProject();
Editor editor = e.getData(CommonDataKeys.EDITOR);
if (project == null || editor == null)
return AnAction.EMPTY_ARRAY;
PsiFile file = PsiUtilBase.getPsiFileInEditor(editor, project);
ArrayList<AnAction> children = ContainerUtil.newArrayList();
for (GoTestFramework framework : GoTestFramework.all()) {
if (framework.isAvailableOnFile(file)) {
children.addAll(framework.getGenerateMethodActions());
}
}
return !children.isEmpty() ? children.toArray(new AnAction[children.size()]) : AnAction.EMPTY_ARRAY;
}
Aggregations