void (@NotNull PsiElement element) { if (element instanceof PsiLanguageInjectionHost && element.isValid()) { InjectedLanguageManager.getInstance(element.getProject()) .enumerate(element, (injectedPsi, places) -> encodeFileReferences(injectedPsi)); } final PsiReference[] refs = element.getReferences(); for (int refIndex = 0; refIndex < refs.length; refIndex++) { PsiReference reference = refs[refIndex]; final PsiFileReference ref = reference instanceof FileReferenceOwner ? ((FileReferenceOwner)reference).getLastFileReference() : null; if (ref != null && encodeFileReference(element, ref, map, refIndex)) break; } super.visitElement(element); }