JetBrains / ExternalAnnotations

JetBrains ReSharper External Annotations
https://www.jetbrains.com/help/resharper/Code_Analysis__External_Annotations.html
MIT License
81 stars 44 forks source link

Annotate Microsoft.AspNetCore.Razor.TagHelpers #179

Open leotsarev opened 4 years ago

leotsarev commented 4 years ago

In particular, please add [MeansImplicitUse] to HtmlTargetElement and HtmlAttributeName

leotsarev commented 4 years ago

Sample code:

    [HtmlTargetElement("button")]
    public class ConditionalDisableTagHelper : TagHelper
    {
        [HtmlAttributeName("asp-is-disabled")]
        public bool IsDisabled { set; get; }

        public override void Process(TagHelperContext context, TagHelperOutput output)
        {
            if (IsDisabled)
            {
                var d = new TagHelperAttribute("disabled", "disabled");
                output.Attributes.Add(d);
            }
            base.Process(context, output);
        }
    }