void (@NotNull Project project, @NotNull Editor editor) { final List<CopyPastePostProcessor<? extends TextBlockTransferableData>> postProcessors = ContainerUtil.filter(CopyPastePostProcessor.EP_NAME.getExtensionList(), p -> p.requiresAllDocumentsToBeCommitted(editor, project)); final List<CopyPastePreProcessor> preProcessors = ContainerUtil.filter(CopyPastePreProcessor.EP_NAME.getExtensionList(), p -> p.requiresAllDocumentsToBeCommitted(editor, project)); final boolean commitAllDocuments = !preProcessors.isEmpty() || !postProcessors.isEmpty(); if (LOG.isDebugEnabled()) { LOG.debug("CommitAllDocuments: " + commitAllDocuments); if (commitAllDocuments) { final String processorNames = StringUtil.join(preProcessors, ",") + "," + StringUtil.join(postProcessors, ","); LOG.debug("Processors with commitAllDocuments requirement: [" + processorNames + "]"); } } if (commitAllDocuments) { PsiDocumentManager.getInstance(project).commitAllDocuments(); } else { PsiDocumentManager.getInstance(project).commitDocument(editor.getDocument()); } }