boolean (@NotNull Project project, Editor editor, PsiFile file) { if (!XsltSupport.isXsltFile(file)) return false; final int offset = editor.getCaretModel().getOffset(); final PsiElement element = file.findElementAt(offset); final XmlAttribute attr = PsiTreeUtil.getParentOfType(element, XmlAttribute.class, false); if (attr == null || attr.getValueElement() == null) { return false; } if (XsltSupport.isXsltTag(attr.getParent())) { return false; } final ASTNode node = attr.getNode(); if (node == null) return false; final ASTNode nameNode = XmlChildRole.ATTRIBUTE_NAME_FINDER.findChild(node); if (nameNode == null) { return false; } else { return nameNode.getTextRange().contains(offset); } }