void (@NotNull PsiReferenceRegistrar registrar) { registrar.registerReferenceProvider(XmlPatterns.xmlAttributeValue().withLocalName("key"), new PsiReferenceProvider() { @Override public boolean acceptsTarget(@NotNull PsiElement target) { return target instanceof PomTargetPsiElement && ((PomTargetPsiElement)target).getTarget() instanceof XmlProperty; } @Override public PsiReference @NotNull [] getReferencesByElement(@NotNull PsiElement element, @NotNull ProcessingContext context) { PropertiesFile propertiesFile = PropertiesImplUtil.getPropertiesFile(element.getContainingFile()); if (propertiesFile == null) return PsiReference.EMPTY_ARRAY; XmlProperty property = new XmlProperty(PsiTreeUtil.getParentOfType(element, XmlTag.class), (XmlPropertiesFileImpl)propertiesFile); return new PsiReference[] {new PsiReferenceBase.Immediate<>(element, PomService.convertToPsi(property))}; } }); }