void (@NotNull AnActionEvent e) { final Project project = e.getProject(); if (project == null) { return; } final Editor hostEditor = e.getData(CommonDataKeys.EDITOR); if (hostEditor == null) { return; } if (hostEditor.isDisposed()) { LOG.error("Action " + this + " invoked on a disposed editor in " + e.getDataContext()); return; } if (!EditorModificationUtil.checkModificationAllowed(hostEditor)) return; PsiFile hostFile = PsiDocumentManager.getInstance(project).getPsiFile(hostEditor.getDocument()); if (hostFile != null && !FileModificationService.getInstance().prepareFileForWrite(hostFile)) return; actionPerformedImpl(project, hostEditor); }