private static @NlsSafe String getPresentablePath(@NotNull Project project, @NotNull VirtualFile virtualFile) {
    String path;
    if (ScratchUtil.isScratch(virtualFile)) {
      path = ScratchUtil.getRelativePath(project, virtualFile);
    }
    else {
      VirtualFile baseDir = project.getBaseDir();
      path = VfsUtilCore.isAncestor(baseDir, virtualFile, true)
             ? VfsUtilCore.getRelativeLocation(virtualFile, baseDir)
             : FileUtil.getLocationRelativeToUserHome(virtualFile.getPath());
    }
    return path == null ? null : StringUtil.trimMiddle(path, 120);
  }
private static @NlsSafe String getPresentablePath(@NotNull Project project, @NotNull VirtualFile virtualFile)