@Nullable private static ContentEntry findContentEntry(ModuleRootModel rootModel, VirtualFile file) { return ContainerUtil.find( rootModel.getContentEntries(), object -> { VirtualFile entryRoot = object.getFile(); return entryRoot != null && VfsUtilCore.isAncestor(entryRoot, file, false); }); }