boolean (@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); } }); }