VirtualFile (@NotNull VirtualFile vFile) { VirtualFile sourceRoot = myProjectFileIndex.getSourceRootForFile(vFile); if (sourceRoot != null) return sourceRoot; VirtualFile contentRoot = myProjectFileIndex.getContentRootForFile(vFile); if (contentRoot != null) return contentRoot; VirtualFile libraryRoot = myProjectFileIndex.getClassRootForFile(vFile); if (libraryRoot != null) return libraryRoot; return null; }