void (PsiElement element, final Map<String, PsiFileSystemItem> map, final TextRange range) { if (element == null || element instanceof PsiCompiledElement || isBinary(element)) return; element.accept(new PsiRecursiveElementVisitor(true) { @Override public void visitElement(@NotNull PsiElement element) { if (!range.intersects(element.getTextRange())) return; String text = element.getText(); PsiFileSystemItem item = map.get(text); element.putCopyableUserData(REF_FILE_SYSTEM_ITEM_KEY, Pair.create(item, -1)); element.acceptChildren(this); } }); decodeFileReferences(element); }