private static @Nullable String getExtensionLocation(Extension element) {
    DomElement parent = element.getParent();
    if (parent instanceof Extensions) {
      String extensionsNamespace = ((Extensions)parent).getDefaultExtensionNs().getStringValue();
      if (Extensions.DEFAULT_PREFIX.equals(extensionsNamespace)) {
        String elementName = element.getXmlElementName();
        if (elementName.equalsIgnoreCase("applicationService") ||
            elementName.equalsIgnoreCase("projectService") ||
            elementName.equalsIgnoreCase("moduleService")) {
          String result = element.getId().getStringValue();
          if (StringUtil.isEmpty(result)) {
            result = toShortName(firstNotNullAttribute(element, "serviceInterface", "serviceImplementation"));
          }
          return result;
        }
        else if (elementName.equalsIgnoreCase("intentionAction")) {
          return toShortName(getSubTagText(element, "className"));
        }
        else if (elementName.equalsIgnoreCase("dom.extender")) {
          String result = element.getId().getStringValue();
          if (StringUtil.isEmpty(result)) {
            result = toShortName(firstNotNullAttribute(element, "extenderClass"));
          }
          return result;
        }
        else if (elementName.equalsIgnoreCase("stacktrace.fold")) {
          return firstNotNullAttribute(element, "substring");
        }
      }
    }

    return guessTagLocation(element);
  }
private static @Nullable String getExtensionLocation(Extension element)