IDEA-85781 "Cancel" for "Scanning files" does nothing

This commit is contained in:
Dmitry Avdeev
2012-05-18 16:30:42 +04:00
parent 695fda4530
commit 11518f3c41
2 changed files with 7 additions and 4 deletions
@@ -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);
@@ -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);
}
}