void (@NotNull AnActionEvent e) { Editor editor = e.getData(CommonDataKeys.EDITOR); boolean enabled = editor != null && e.getData(LangDataKeys.CONSOLE_VIEW) != null && new JsonLineExtractor(editor).has(); e.getPresentation().setEnabledAndVisible(enabled); }