boolean (PsiElement element, PsiFileReference ref, Map<String, PsiFileSystemItem> map, int refIndex) { final ResolveResult[] results = ref.multiResolve(false); for (ResolveResult result : results) { if (result.getElement() instanceof PsiFileSystemItem fileSystemItem) { element.putCopyableUserData(REF_FILE_SYSTEM_ITEM_KEY, Pair.create(fileSystemItem, refIndex)); map.put(element.getText(), fileSystemItem); return true; } } return false; }