void (@NotNull final Project project, @NotNull final Editor editor, @NotNull PsiFile file) { if (!EditorModificationUtil.checkModificationAllowed(editor)) return; if (!FileDocumentManager.getInstance().requestWriting(editor.getDocument(), project)){ return; } Language language = PsiUtilCore.getLanguageAtOffset(file, editor.getCaretModel().getOffset()); final LanguageCodeInsightActionHandler codeInsightActionHandler = CodeInsightActions.DELEGATE_METHODS.forLanguage(language); if (codeInsightActionHandler != null) { codeInsightActionHandler.invoke(project, editor, file); } }