public static boolean isInLibraryContent(@Nullable VirtualFile file, @NotNull Project project) {
    return ReadAction.compute(() -> {
      if (file == null) {
        return true;
      }
      else {
        ProjectFileIndex projectFileIndex = ProjectRootManager.getInstance(project).getFileIndex();
        return projectFileIndex.isInLibrary(file);
      }
    });
  }
public static boolean isInLibraryContent(@Nullable VirtualFile file, @NotNull Project project)