ExtensionPoint (PsiManager psiManager, DomManager domManager, VirtualFile file, int offset) { PsiFile psiFile = psiManager.findFile(file); if (!(psiFile instanceof XmlFile)) return null; XmlTag xmlTag = AstLoadingFilter.forceAllowTreeLoading(psiFile, () -> { PsiElement psiElement = psiFile.findElementAt(offset); return PsiTreeUtil.getParentOfType(psiElement, XmlTag.class, false); }); final DomElement domElement = domManager.getDomElement(xmlTag); return ObjectUtils.tryCast(domElement, ExtensionPoint.class); }