public static @Nullable XmlTag findScopeTag(@Nullable XmlTag context) {
    Map<String, XmlTag> id2tag = findScopesWithItemRef(context != null ? context.getContainingFile() : null);
    XmlTag tag = context;
    while (tag != null) {
      if (tag != context && tag.getAttribute(ITEM_SCOPE) != null) return tag;
      final String id = getStripedAttributeValue(tag, HtmlUtil.ID_ATTRIBUTE_NAME);
      if (id != null && id2tag.containsKey(id)) return id2tag.get(id);
      tag = tag.getParentTag();
    }
    return null;
  }
public static @Nullable XmlTag findScopeTag(@Nullable XmlTag context)