Set<VirtualFile> (@NotNull GlobalSearchScope searchScope) { Set<VirtualFile> files = new LinkedHashSet<>(); dumbService.runReadActionInSmartMode(() -> { if (!samClass.isValid()) return; String className = samClass.getName(); Project project = samClass.getProject(); if (className == null) return; Set<String> likelyNames = ContainerUtil.newLinkedHashSet(className); StubIndex.getInstance().processElements(JavaMethodParameterTypesIndex.getInstance().getKey(), className, project, effectiveUseScope, PsiMethod.class, method -> { ProgressManager.checkCanceled(); likelyNames.add(method.getName()); return true; }); PsiSearchHelperImpl helper = (PsiSearchHelperImpl)PsiSearchHelper.getInstance(project); Processor<VirtualFile> processor = Processors.cancelableCollectProcessor(files); for (String word : likelyNames) { helper.processCandidateFilesForText(searchScope, UsageSearchContext.IN_CODE, true, true, word, processor); } }); return files; }