diff --git a/platform/lang-impl/src/com/intellij/openapi/roots/impl/ProjectRootManagerComponent.java b/platform/lang-impl/src/com/intellij/openapi/roots/impl/ProjectRootManagerComponent.java index a74334679abd..7dc1eae4a88c 100644 --- a/platform/lang-impl/src/com/intellij/openapi/roots/impl/ProjectRootManagerComponent.java +++ b/platform/lang-impl/src/com/intellij/openapi/roots/impl/ProjectRootManagerComponent.java @@ -186,7 +186,6 @@ public class ProjectRootManagerComponent extends ProjectRootManagerImpl implemen ApplicationManager.getApplication().assertIsDispatchThread(); if (myProject.isDefault()) return null; - final Set dirUrls = new THashSet<>(FileUtil.PATH_HASHING_STRATEGY); final Set recursiveDirs = new THashSet<>(FileUtil.PATH_HASHING_STRATEGY); final Set recursiveDirUrls = new THashSet<>(FileUtil.PATH_HASHING_STRATEGY); final Set files = new THashSet<>(FileUtil.PATH_HASHING_STRATEGY); @@ -194,7 +193,9 @@ public class ProjectRootManagerComponent extends ProjectRootManagerImpl implemen final String projectFilePath = myProject.getProjectFilePath(); final File projectDirFile = projectFilePath == null ? null : new File(projectFilePath).getParentFile(); if (projectDirFile != null && projectDirFile.getName().equals(Project.DIRECTORY_STORE_FOLDER)) { - dirUrls.add(VfsUtilCore.pathToUrl(projectDirFile.getAbsolutePath())); + String absolutePath = projectDirFile.getAbsolutePath(); + recursiveDirs.add(absolutePath); + recursiveDirUrls.add(VfsUtilCore.pathToUrl(absolutePath)); } else { files.add(projectFilePath); @@ -221,7 +222,6 @@ public class ProjectRootManagerComponent extends ProjectRootManagerImpl implemen VirtualFilePointerContainer container = VirtualFilePointerManager.getInstance().createContainer(myRootPointersDisposable, getRootsValidityChangedListener()); ((VirtualFilePointerContainerImpl)container).addAllJarDirectories(recursiveDirUrls, true); - ((VirtualFilePointerContainerImpl)container).addAllJarDirectories(dirUrls, false); files.forEach(path -> container.add(VfsUtilCore.pathToUrl(path))); Disposer.dispose(oldDisposable); // dispose after the re-creating container to keep virtual file pointers from disposing and re-creating back