diff --git a/platform/lang-impl/src/com/intellij/openapi/roots/impl/DirectoryIndexComponent.java b/platform/lang-impl/src/com/intellij/openapi/roots/impl/DirectoryIndexComponent.java index bbb30af153ea..ab82128a8c24 100644 --- a/platform/lang-impl/src/com/intellij/openapi/roots/impl/DirectoryIndexComponent.java +++ b/platform/lang-impl/src/com/intellij/openapi/roots/impl/DirectoryIndexComponent.java @@ -117,7 +117,7 @@ public class DirectoryIndexComponent extends DirectoryIndexImpl { VirtualFile f = file.findFileByRelativePath(rel); if (f != null) { if (state == originalState) state = state.copy(); - state.fillMapWithModuleContent(f, eachModule, f); + state.fillMapWithModuleContent(f, eachModule, f, null); } } } @@ -133,7 +133,7 @@ public class DirectoryIndexComponent extends DirectoryIndexImpl { } if (state == originalState) state = state.copy(); - state.fillMapWithModuleContent(file, module, parentInfo.contentRoot); + state.fillMapWithModuleContent(file, module, parentInfo.contentRoot, null); String parentPackage = state.myDirToPackageName.get(parent); diff --git a/platform/projectModel-impl/src/com/intellij/openapi/roots/impl/DirectoryIndexImpl.java b/platform/projectModel-impl/src/com/intellij/openapi/roots/impl/DirectoryIndexImpl.java index 144ce1153619..ce23cac4706c 100644 --- a/platform/projectModel-impl/src/com/intellij/openapi/roots/impl/DirectoryIndexImpl.java +++ b/platform/projectModel-impl/src/com/intellij/openapi/roots/impl/DirectoryIndexImpl.java @@ -263,12 +263,15 @@ public class DirectoryIndexImpl extends DirectoryIndex { return info; } - void fillMapWithModuleContent(VirtualFile root, final Module module, final VirtualFile contentRoot) { + void fillMapWithModuleContent(VirtualFile root, final Module module, final VirtualFile contentRoot, @Nullable final ProgressIndicator progress) { VfsUtilCore.visitChildrenRecursively(root, new DirectoryVisitor() { @Override protected DirectoryInfo updateInfo(VirtualFile file) { + if (progress != null) { + progress.checkCanceled(); + } if (isExcluded(contentRoot, file)) return null; if (isIgnored(file)) return null; @@ -332,7 +335,7 @@ public class DirectoryIndexImpl extends DirectoryIndex { } for (final VirtualFile contentRoot : contentRoots) { - fillMapWithModuleContent(contentRoot, module, contentRoot); + fillMapWithModuleContent(contentRoot, module, contentRoot, progress); } }