void (@NotNull final ReferencesSearch.SearchParameters params, @NotNull final Processor<? super PsiReference> consumer) { final PsiElement element = params.getElementToSearch(); if (!(element instanceof PyElement) && !(element instanceof PsiDirectory)) { return; } SearchScope searchScope = params.getEffectiveSearchScope(); if (searchScope instanceof GlobalSearchScope) { searchScope = GlobalSearchScope.getScopeRestrictedByFileTypes((GlobalSearchScope)searchScope, PythonFileType.INSTANCE); } String name = PySearchUtil.computeElementNameForStringSearch(element); if (StringUtil.isEmpty(name)) { return; } params.getOptimizer().searchWord(name, searchScope, UsageSearchContext.IN_STRINGS, true, element); }