String (@NotNull PomTarget element, @NotNull ElementDescriptionLocation location) { if (!(element instanceof DomTarget target)) return null; DomElement domElement = target.getDomElement(); final ElementPresentationTemplate template = domElement.getChildDescription().getPresentationTemplate(); final ElementPresentation presentation = template != null ? template.createPresentation(domElement) : domElement.getPresentation(); if (location == UsageViewTypeLocation.INSTANCE) { return presentation.getTypeName(); } if (location == UsageViewNodeTextLocation.INSTANCE || location == UsageViewLongNameLocation.INSTANCE) { return presentation.getTypeName() + " " + StringUtil.notNullize(presentation.getElementName(), "''"); } if (location instanceof HighlightUsagesDescriptionLocation) { return presentation.getTypeName(); } return null; }