boolean (@NotNull Project project, @NotNull ModCreateFile create) { FutureVirtualFile file = create.file(); VirtualFile parent = actualize(file.getParent()); try { return WriteAction.compute(() -> { VirtualFile newFile = parent.createChildData(this, file.getName()); PsiFile psiFile = PsiManager.getInstance(project).findFile(newFile); if (psiFile == null) return false; Document document = psiFile.getViewProvider().getDocument(); document.setText(create.text()); PsiDocumentManager.getInstance(project).commitDocument(document); return true; }); } catch (IOException e) { executeMessage(project, new ModDisplayMessage(e.getMessage(), ModDisplayMessage.MessageKind.ERROR)); return false; } }