@RequiresWriteLock
  public static @Nullable CreateFilePathFix.CreatedFile createFileForFix(@NotNull Project project,
                                                                         @NotNull PsiDirectory currentDirectory,
                                                                         @NotNull String fileName,
                                                                         @Nullable String fileContent) {
    String newFileName = fileName;
    String newDirectories = null;
    if (fileName.contains("/")) {
      int pos = fileName.lastIndexOf('/');
      newFileName = fileName.substring(pos + 1);
      newDirectories = fileName.substring(0, pos);
    }
    PsiDirectory directory = currentDirectory;
    if (newDirectories != null) {
      try {
        VfsUtil.createDirectoryIfMissing(currentDirectory.getVirtualFile(), newDirectories);
        VirtualFile vfsDir = VfsUtil.findRelativeFile(currentDirectory.getVirtualFile(),
                                                      ArrayUtilRt.toStringArray(StringUtil.split(newDirectories, "/")));

        if (vfsDir == null) {
          Logger.getInstance(CreateFilePathFix.class)
            .warn("Unable to find relative file" + currentDirectory.getVirtualFile().getPath());
          return null;
        }

        directory = currentDirectory.getManager().findDirectory(vfsDir);
        if (directory == null) throw new IOException("Couldn't create directory '" + newDirectories + "'");
      }
      catch (IOException e) {
        throw new IncorrectOperationException(e.getMessage());
      }
    }
    PsiFile newFile = directory.createFile(newFileName);
    String text = fileContent;

    if (text != null) {
      FileType type = FileTypeRegistry.getInstance().getFileTypeByFileName(newFileName);
      PsiFile psiFile = PsiFileFactory.getInstance(project).createFileFromText("_" + newFileName, type, text);
      PsiElement psiElement = CodeStyleManager.getInstance(project).reformat(psiFile);
      text = psiElement.getText();
    }

    return new CreatedFile(directory, newFile, text);
  }
@RequiresWriteLock
  public static @Nullable CreateFilePathFix.CreatedFile createFileForFix(@NotNull Project project,
                                                                         @NotNull PsiDirectory currentDirectory,
                                                                         @NotNull String fileName,
                                                                         @Nullable String fileContent)