highlighting: do not report elements as unused if they may have usages in unloaded modules (IDEA-27471)

This commit is contained in:
nik
2017-06-09 16:40:07 +02:00
parent 0d61e56b64
commit 4fb8c04d6f

View File

@@ -926,6 +926,10 @@ public class PsiSearchHelperImpl implements PsiSearchHelper {
@NotNull final GlobalSearchScope scope,
@Nullable final PsiFile fileToIgnoreOccurrencesIn,
@Nullable final ProgressIndicator progress) {
if (!ReadAction.compute(() -> scope.getUnloadedModulesBelongingToScope().isEmpty())) {
return SearchCostResult.TOO_MANY_OCCURRENCES;
}
final AtomicInteger count = new AtomicInteger();
final ProgressIndicator indicator = progress == null ? new EmptyProgressIndicator() : progress;
final Processor<VirtualFile> processor = new Processor<VirtualFile>() {