// This is the ReSharper 8.1 version public RichTextBlock GetElementDescription(IDeclaredElement element, DeclaredElementDescriptionStyle style, PsiLanguageType language, IPsiModule module) { var attribute = element as IHtmlAttributeDeclaredElement; if (attribute == null) return null; var attributeDescription = GetAttributeDescription(attribute.ShortName); var block = new RichTextBlock(); var typeDescription = new RichText(htmlDescriptionsCache.GetDescriptionForHtmlValueType(attribute.ValueType)); if (style.IntendedDescriptionPlacement == DescriptionPlacement.AFTER_NAME && (style.ShowSummary || style.ShowFullDescription)) block.SplitAndAdd(typeDescription); string description = null; if (style.ShowSummary && attributeDescription != null) description = attributeDescription.Summary; else if (style.ShowFullDescription && attributeDescription != null) description = attributeDescription.Description; if (!string.IsNullOrEmpty(description)) block.SplitAndAdd(description); if (style.IntendedDescriptionPlacement == DescriptionPlacement.ON_THE_NEW_LINE && (style.ShowSummary || style.ShowFullDescription)) { // TODO: Perhaps we should show Value: Expression for attributes that take an Angular expression, etc typeDescription.Prepend("Value: "); block.SplitAndAdd(typeDescription); } return block; }
// This is the ReSharper 8.1 version public RichTextBlock GetElementDescription(IDeclaredElement element, DeclaredElementDescriptionStyle style, PsiLanguageType language, IPsiModule module) { var attribute = element as IHtmlAttributeDeclaredElement; if (attribute == null) { return(null); } var attributeDescription = GetAttributeDescription(attribute.ShortName); var block = new RichTextBlock(); var typeDescription = new RichText(htmlDescriptionsCache.GetDescriptionForHtmlValueType(attribute.ValueType)); if (style.IntendedDescriptionPlacement == DescriptionPlacement.AFTER_NAME && (style.ShowSummary || style.ShowFullDescription)) { block.SplitAndAdd(typeDescription); } string description = null; if (style.ShowSummary && attributeDescription != null) { description = attributeDescription.Summary; } else if (style.ShowFullDescription && attributeDescription != null) { description = attributeDescription.Description; } if (!string.IsNullOrEmpty(description)) { block.SplitAndAdd(description); } if (style.IntendedDescriptionPlacement == DescriptionPlacement.ON_THE_NEW_LINE && (style.ShowSummary || style.ShowFullDescription)) { // TODO: Perhaps we should show Value: Expression for attributes that take an Angular expression, etc typeDescription.Prepend("Value: "); block.SplitAndAdd(typeDescription); } return(block); }