VirtualFile (@NotNull VirtualFile file, final boolean honorExclusion) { WorkspaceFileSetWithCustomData<ModuleContentOrSourceRootData> fileSet = myWorkspaceFileIndex.findFileSetWithCustomData(file, honorExclusion, true, false, false, false, ModuleContentOrSourceRootData.class); if (fileSet == null) { if (!honorExclusion) { WorkspaceFileSetWithCustomData<UnloadedModuleContentRootData> unloadedFileSet = myWorkspaceFileIndex.findFileSetWithCustomData(file, false, true, false, false, false, UnloadedModuleContentRootData.class); if (unloadedFileSet != null) return unloadedFileSet.getRoot(); } return null; } VirtualFile contentRoot = fileSet.getData().getCustomContentRoot(); if (contentRoot != null) { return contentRoot; } return fileSet.getRoot(); }