diff --git a/platform/platform-impl/src/com/intellij/openapi/project/CacheUpdateRunner.java b/platform/platform-impl/src/com/intellij/openapi/project/CacheUpdateRunner.java index c620877fbad8..8c2c2248b10f 100644 --- a/platform/platform-impl/src/com/intellij/openapi/project/CacheUpdateRunner.java +++ b/platform/platform-impl/src/com/intellij/openapi/project/CacheUpdateRunner.java @@ -44,6 +44,8 @@ public class CacheUpdateRunner { private static final Key FAILED_TO_INDEX = Key.create("FAILED_TO_INDEX"); private static final int PROC_COUNT = Runtime.getRuntime().availableProcessors(); + private static final int FILE_SIZE_TO_SHOW_THRESHOLD = 500 * 1024; + public static void processFiles(final ProgressIndicator indicator, boolean processInReadAction, Collection files, @@ -57,7 +59,7 @@ public class CacheUpdateRunner { // need set here to handle queue.pushbacks after checkCancelled() in order // not to count the same file several times final Set processed = new THashSet(); - private boolean fileNameWasShownAfterRestart; + private boolean fileNameWasShown; @Override public void consume(VirtualFile virtualFile) { @@ -65,12 +67,12 @@ public class CacheUpdateRunner { synchronized (processed) { boolean added = processed.add(virtualFile); indicator.setFraction(processed.size() / total); - if (!added) { + if (!added || virtualFile.getLength() > FILE_SIZE_TO_SHOW_THRESHOLD) { indicator.setText2(virtualFile.getPresentableUrl()); - fileNameWasShownAfterRestart = true; - } else if (fileNameWasShownAfterRestart) { + fileNameWasShown = true; + } else if (fileNameWasShown) { indicator.setText2(""); - fileNameWasShownAfterRestart = false; + fileNameWasShown = false; } } }