void (String stringToFind, PsiSearchHelper searchHelper, GlobalSearchScope scope, final Set<? super PsiFile> resultFiles) { final List<String> words = StringUtil.getWordsIn(stringToFind); if (words.isEmpty()) return; words.sort((o1, o2) -> o2.length() - o1.length()); for (String word : words) { final Set<PsiFile> files = new HashSet<>(); searchHelper.processAllFilesWithWord(word, scope, Processors.cancelableCollectProcessor(files), true); if (resultFiles.isEmpty()) { resultFiles.addAll(files); } else { resultFiles.retainAll(files); } if (resultFiles.isEmpty()) return; } }