String (@NotNull PsiElement element) { if (element instanceof XmlTag tag) { PsiElement parent = tag.getParent(); StringBuilder buffer = new StringBuilder(); buffer.append("tag").append(ELEMENT_TOKENS_SEPARATOR); String name = tag.getName(); buffer.append(name.length() == 0 ? "<unnamed>" : escape(name)); buffer.append(ELEMENT_TOKENS_SEPARATOR); int childIndex = getChildIndex(tag, parent, name, XmlTag.class); if (childIndex < 0) return null; buffer.append(childIndex); if (!(parent instanceof PsiFile)) { String parentSignature = getSignature(parent); if (parentSignature == null) { return null; } buffer.append(";"); buffer.append(parentSignature); } return buffer.toString(); } return null; }