void (@NotNull final ReferencesSearch.SearchParameters queryParameters, @NotNull final Processor<? super PsiReference> consumer) { ApplicationManager.getApplication().runReadAction(() -> { final PsiElement refElement = queryParameters.getElementToSearch(); if (PyMagicLiteralTools.couldBeMagicLiteral(refElement)) { final String refText = ((StringLiteralExpression)refElement).getStringValue(); if (!StringUtil.isEmpty(refText)) { final SearchScope searchScope = queryParameters.getEffectiveSearchScope(); queryParameters.getOptimizer().searchWord(refText, searchScope, true, refElement); } } }); }