boolean (@NotNull Project project, @NotNull Editor editor, @NotNull final PsiFile file) { Language language = PsiUtilCore.getLanguageAtOffset(file, editor.getCaretModel().getOffset()); final LanguageCodeInsightActionHandler codeInsightActionHandler = CodeInsightActions.DELEGATE_METHODS.forLanguage(language); if (codeInsightActionHandler != null) { return codeInsightActionHandler.isValidFor(editor, file); } return false; }