boolean (Project project, VirtualFile file) { final ProjectFileIndex projectFileIndex = ProjectRootManager.getInstance(project).getFileIndex(); return ReadAction.compute(() -> projectFileIndex.isInLibrarySource(file)); }