public static RazorDiagnostic Create_ChildContentMixedWithExplicitChildContent(SourceSpan?source, ComponentIntermediateNode component)
        {
            var supportedElements = string.Join(", ", component.Component.GetChildContentProperties().Select(p => $"'{p.Name}'"));

            return(RazorDiagnostic.Create(ChildContentMixedWithExplicitChildContent, source ?? SourceSpan.Undefined, component.TagName, supportedElements));
        }
 public static RazorDiagnostic Create_UnsupportedTagHelperDirective(SourceSpan?source)
 {
     return(RazorDiagnostic.Create(UnsupportedTagHelperDirective, source ?? SourceSpan.Undefined));
 }
 public static string Serialize(RazorDiagnostic diagnostic)
 {
     return(diagnostic.ToString());
 }
 public static RazorDiagnostic Create_ChildContentHasInvalidAttribute(SourceSpan? source, string attribute, string element)
 {
     return RazorDiagnostic.Create(ChildContentHasInvalidAttribute, source ?? SourceSpan.Undefined, attribute, element);
 }
 public static RazorDiagnostic Create_InvalidHtmlContent(SourceSpan?span, string text)
 {
     return(RazorDiagnostic.Create(InvalidHtmlContent, span ?? SourceSpan.Undefined, text));
 }
    public static BoundAttributeDescriptorBuilder AddDiagnostic(this BoundAttributeDescriptorBuilder builder, RazorDiagnostic diagnostic)
    {
        if (builder == null)
        {
            throw new ArgumentNullException(nameof(builder));
        }

        builder.Diagnostics.Add(diagnostic);

        return(builder);
    }
Example #7
0
 public static RazorDiagnostic Create_MismatchedClosingTag(SourceSpan?span, string expectedTagName, string tagName)
 {
     return(RazorDiagnostic.Create(MismatchedClosingTag, span ?? SourceSpan.Undefined, expectedTagName, tagName));
 }
 public static RazorDiagnostic Create_UnclosedTag(SourceSpan?span, string tagName)
 {
     return(RazorDiagnostic.Create(UnclosedTag, span ?? SourceSpan.Undefined, tagName));
 }
Example #9
0
 public static RazorDiagnostic Create_RefSuppressFieldNotMinimized(SourceSpan?source = null)
 {
     return(RazorDiagnostic.Create(RefSuppressFieldNotMinimized, source ?? SourceSpan.Undefined));
 }
Example #10
0
 public static RazorDiagnostic Create_RefSuppressFieldRequiredForGeneric(SourceSpan?source = null)
 {
     return(RazorDiagnostic.Create(RefSuppressFieldRequiredForGeneric, source ?? SourceSpan.Undefined));
 }
Example #11
0
 public static RazorDiagnostic Create_DuplicateComponentParameterDirective(string attributeName, string directiveAttributeName, SourceSpan?source = null)
 {
     return(RazorDiagnostic.Create(DuplicateComponentParameterDirective, source ?? SourceSpan.Undefined, attributeName, directiveAttributeName));
 }
Example #12
0
 public static RazorDiagnostic Create_DuplicateMarkupAttribute(string attributeName, SourceSpan?source = null)
 {
     return(RazorDiagnostic.Create(DuplicateMarkupAttribute, source ?? SourceSpan.Undefined, attributeName));
 }
 public static RazorDiagnostic Create_UnexpectedClosingTag(SourceSpan? span, string tagName)
 {
     return RazorDiagnostic.Create(UnexpectedClosingTag, span ?? SourceSpan.Undefined, tagName);
 }
 public static RazorDiagnostic Create_ChildContentHasInvalidParameterOnComponent(SourceSpan?source, string attribute, string element)
 {
     return(RazorDiagnostic.Create(ChildContentHasInvalidParameterOnComponent, source ?? SourceSpan.Undefined, attribute, element));
 }
    public static TagMatchingRuleDescriptorBuilder AddDiagnostic(this TagMatchingRuleDescriptorBuilder builder, RazorDiagnostic diagnostic)
    {
        if (builder == null)
        {
            throw new ArgumentNullException(nameof(builder));
        }

        builder.Diagnostics.Add(diagnostic);

        return(builder);
    }
 public static RazorDiagnostic Create_UnsupportedComponentImportContent(SourceSpan?source)
 {
     return(RazorDiagnostic.Create(UnsupportedComponentImportContent, source ?? SourceSpan.Undefined));
 }
        public static RazorDiagnostic CreatePageDirective_MustSpecifyRoute(SourceSpan?source)
        {
            var diagnostic = RazorDiagnostic.Create(PageDirective_MustSpecifyRoute, source ?? SourceSpan.Undefined);

            return(diagnostic);
        }
 public static RazorDiagnostic Create_UnexpectedClosingTagForVoidElement(SourceSpan?span, string tagName)
 {
     return(RazorDiagnostic.Create(UnexpectedClosingTagForVoidElement, span ?? SourceSpan.Undefined, tagName));
 }
        // Reserved: BL9993 Component parameters should not be public

        public static RazorDiagnostic Create_DisallowedScriptTag(SourceSpan?source)
        {
            var diagnostic = RazorDiagnostic.Create(DisallowedScriptTag, source ?? SourceSpan.Undefined);

            return(diagnostic);
        }
 public static RazorDiagnostic Create_MultipleComponents(SourceSpan?span, string tagName, IEnumerable <TagHelperDescriptor> components)
 {
     return(RazorDiagnostic.Create(MultipleComponents, span ?? SourceSpan.Undefined, tagName, string.Join(", ", components.Select(c => c.DisplayName))));
 }
 public static RazorDiagnostic Create_TemplateInvalidLocation(SourceSpan?source)
 {
     return(RazorDiagnostic.Create(TemplateInvalidLocation, source ?? SourceSpan.Undefined));
 }
Example #22
0
 /// <summary>
 /// Tracks the given <paramref name="error"/>.
 /// </summary>
 /// <param name="error">The <see cref="RazorDiagnostic"/> to track.</param>
 public void OnError(RazorDiagnostic error) => _errors.Add(error);
 public static RazorDiagnostic Create_ChildContentSetByAttributeAndBody(SourceSpan?source, string attribute)
 {
     return(RazorDiagnostic.Create(ChildContentSetByAttributeAndBody, source ?? SourceSpan.Undefined, attribute));
 }
        public static RazorDiagnostic Create_UnsupportedComplexContent(IntermediateNode node, string attributeName)
        {
            var content = string.Join("", node.FindDescendantNodes <IntermediateToken>().Select(t => t.Content));

            return(RazorDiagnostic.Create(UnsupportedComplexContent, node.Source ?? SourceSpan.Undefined, attributeName, content));
        }
Example #25
0
    public static RazorDiagnostic CreatePageDirective_MustExistAtTheTopOfFile(SourceSpan source)
    {
        var diagnostic = RazorDiagnostic.Create(PageDirective_MustExistAtTheTopOfFile, source, PageDirective.Directive.Directive);

        return(diagnostic);
    }