boolean (@NotNull PsiElement element) { getReferences(element); if (element instanceof PyStringLiteralExpression) { final PsiLanguageInjectionHost host = (PsiLanguageInjectionHost)element; final List<Pair<PsiElement, TextRange>> files = InjectedLanguageManager.getInstance(project).getInjectedPsiFiles(host); if (files != null) { for (Pair<PsiElement, TextRange> pair : files) { final PsiElement first = pair.getFirst(); if (first instanceof ScopeOwner scopeOwner) { PsiTreeUtil.processElements(scopeOwner, new PsiElementProcessor<>() { @Override public boolean execute(@NotNull PsiElement element) { getReferences(element); return true; } }); } } } } return true; }