4 instantiations of RazorDiagnostic
Microsoft.CodeAnalysis.Razor.Compiler (4)
Language\RazorDiagnostic.cs (4)
30
=>
new
(descriptor, span: null, args: null);
33
=>
new
(descriptor, span, args: null);
36
=>
new
(descriptor, span: null, args);
39
=>
new
(descriptor, span, args);
757 references to RazorDiagnostic
Microsoft.AspNetCore.Mvc.Razor.Extensions.UnitTests (13)
RazorPageDocumentClassifierPassTest.cs (4)
40
var
expectedDiagnostic = RazorExtensionsDiagnosticFactory.CreatePageDirective_CannotBeImported(sourceSpan);
55
var
diagnostic = Assert.Single(directive.Node.Diagnostics);
72
var
expectedDiagnostic = RazorExtensionsDiagnosticFactory.CreatePageDirective_MustExistAtTheTopOfFile(sourceSpan);
91
var
diagnostic = Assert.Single(directive.Node.Diagnostics);
ViewComponentTagHelperDescriptorFactoryTest.cs (9)
209
var
diagnostic = Assert.Single(descriptor.GetAllDiagnostics());
226
var
diagnostic = Assert.Single(descriptor.GetAllDiagnostics());
243
var
diagnostic = Assert.Single(descriptor.GetAllDiagnostics());
292
var
diagnostic = Assert.Single(descriptor.GetAllDiagnostics());
309
var
diagnostic = Assert.Single(descriptor.GetAllDiagnostics());
326
var
diagnostic = Assert.Single(descriptor.GetAllDiagnostics());
343
var
diagnostic = Assert.Single(descriptor.GetAllDiagnostics());
360
var
diagnostic = Assert.Single(descriptor.GetAllDiagnostics());
377
var
diagnostic = Assert.Single(descriptor.GetAllDiagnostics());
Microsoft.AspNetCore.Razor.Language.UnitTests (135)
CodeGeneration\CodeRenderingContextTest.cs (12)
21
var
diagnostic =
RazorDiagnostic
.Create(descriptor, SourceSpan.Undefined, "param");
52
var
diagnostic =
RazorDiagnostic
.Create(descriptor, SourceSpan.Undefined, "param");
79
var
alwaysOn =
RazorDiagnostic
.Create(
82
var
level11 =
RazorDiagnostic
.Create(
85
var
level12 =
RazorDiagnostic
.Create(
88
var
level13 =
RazorDiagnostic
.Create(
Components\ComponentDuplicateAttributeDiagnosticPassTest.cs (3)
85
var
diagnostic = Assert.Single(documentNode.GetAllDiagnostics());
113
var
diagnostic = Assert.Single(documentNode.GetAllDiagnostics());
149
var
diagnostic = diagnostics[i];
Components\ComponentMarkupBlockPassTest.cs (1)
407
var
diagnostic = Assert.Single(documentNode.GetAllDiagnostics());
DefaultRazorCSharpLoweringPhaseTest.cs (3)
71
var
expectedDiagnostic =
RazorDiagnostic
.Create(
83
var
diagnostic = Assert.Single(csharpDocument.Diagnostics);
DefaultRazorIntermediateNodeLoweringPhaseTest.cs (5)
184
var
expectedDiagnostic = RazorDiagnosticFactory.CreateDirective_BlockDirectiveCannotBeImported("custom");
193
var
diagnostic = Assert.Single(documentNode.GetAllDiagnostics());
217
var
expectedDiagnostic = RazorDiagnosticFactory.CreateDirective_BlockDirectiveCannotBeImported("custom");
226
var
diagnostic = Assert.Single(documentNode.GetAllDiagnostics());
273
var
diagnostic = Assert.Single(documentNode.Diagnostics);
DefaultRazorTagHelperBinderPhaseTest.cs (5)
476
var
initialError =
RazorDiagnostic
.Create(
479
var
expectedRewritingError = RazorDiagnosticFactory.CreateParsing_TagHelperFoundMalformedTagHelper(
495
Assert.Equal<
RazorDiagnostic
>([initialError, expectedRewritingError], outputTree.Diagnostics);
979
var
diagnostic = Assert.Single(directiveChunkGenerator.Diagnostics);
DirectiveRemovalOptimizationPassTest.cs (3)
88
var
expectedDiagnostic =
RazorDiagnostic
.Create(new RazorDiagnosticDescriptor("RZ9999", "Some diagnostic message.", RazorDiagnosticSeverity.Error));
102
var
diagnostic = Assert.Single(documentNode.Diagnostics);
Extensions\DefaultTagHelperTargetExtensionTest.cs (6)
409
var
expectedDiagnostic = RazorDiagnosticFactory.CreateTagHelper_CodeBlocksNotSupportedInAttributes(expectedLocation);
415
var
diagnostic = Assert.Single(context.GetDiagnostics());
431
var
expectedDiagnostic = RazorDiagnosticFactory.CreateTagHelper_InlineMarkupBlocksNotSupportedInAttributes(expectedLocation, "System.Int32");
437
var
diagnostic = Assert.Single(context.GetDiagnostics());
453
var
expectedDiagnostic = RazorDiagnosticFactory.CreateTagHelper_InlineMarkupBlocksNotSupportedInAttributes(
461
var
diagnostic = Assert.Single(context.GetDiagnostics());
IntegrationTests\ComponentBindIntegrationTest.cs (3)
40
var
diagnostic = Assert.Single(result.RazorDiagnostics);
61
var
diagnostic = Assert.Single(generated.RazorDiagnostics);
76
var
diagnostic = Assert.Single(generated.RazorDiagnostics);
IntegrationTests\ComponentChildContentIntegrationTest.cs (8)
70
var
diagnostic = Assert.Single(generated.RazorDiagnostics);
90
var
diagnostic = Assert.Single(generated.RazorDiagnostics);
109
var
diagnostic = Assert.Single(generated.RazorDiagnostics);
195
var
diagnostic = Assert.Single(generated.RazorDiagnostics);
213
var
diagnostic = Assert.Single(generated.RazorDiagnostics);
235
var
diagnostic = Assert.Single(generated.RazorDiagnostics);
255
var
diagnostic = Assert.Single(generated.RazorDiagnostics);
276
var
diagnostic = Assert.Single(generated.RazorDiagnostics);
IntegrationTests\ComponentCodeGenerationTestBase.cs (17)
1112
var
diagnostics = Assert.Single(generated.RazorDiagnostics);
1571
var
diagnostics = Assert.Single(generated.RazorDiagnostics);
1691
var
diagnostics = Assert.Single(generated.RazorDiagnostics);
7410
var
diagnostic = Assert.Single(generated.RazorDiagnostics);
7690
var
diagnostic = Assert.Single(generated.RazorDiagnostics);
7871
var
diagnostic = Assert.Single(generated.RazorDiagnostics);
8019
var
diagnostic = Assert.Single(generated.RazorDiagnostics);
11208
var
diagnostic = Assert.Single(generated.RazorDiagnostics);
11228
var
diagnostic = Assert.Single(generated.RazorDiagnostics);
11274
var
diagnostic = Assert.Single(generated.RazorDiagnostics);
11298
var
diagnostic = Assert.Single(generated.RazorDiagnostics);
11322
var
diagnostic = Assert.Single(generated.RazorDiagnostics);
11351
var
diagnostic = Assert.Single(generated.RazorDiagnostics);
11411
var
diagnostic = Assert.Single(generated.RazorDiagnostics);
11446
var
diagnostic = Assert.Single(generated.RazorDiagnostics);
11481
var
diagnostic = Assert.Single(generated.RazorDiagnostics);
11516
var
diagnostic = Assert.Single(generated.RazorDiagnostics);
IntegrationTests\ComponentDiagnosticRazorIntegrationTest.cs (6)
43
var
diagnostic = Assert.Single(generated.RazorDiagnostics);
103
var
diagnostic = Assert.Single(generated.RazorDiagnostics);
121
var
diagnostic = Assert.Single(generated.RazorDiagnostics);
142
var
diagnostic = Assert.Single(generated.RazorDiagnostics);
162
var
diagnostic = Assert.Single(generated.RazorDiagnostics);
214
var
diagnostic = Assert.Single(generated.RazorDiagnostics);
IntegrationTests\ComponentGenericTypeIntegrationTest.cs (4)
95
var
diagnostic = Assert.Single(generated.RazorDiagnostics);
114
var
diagnostic = Assert.Single(generated.RazorDiagnostics);
371
var
diagnostic = generated.RazorDiagnostics.Single();
435
var
ambiguityDiagnostic = generated.RazorDiagnostics.Single(d => d.Id == "RZ10012");
IntegrationTests\ComponentRenderModeAttributeIntegrationTests.cs (3)
28
var
diagnostic = Assert.Single(generated.RazorDiagnostics);
41
var
diag = Assert.Single(generated.RazorDiagnostics);
57
var
diagnostic = Assert.Single(generated.RazorDiagnostics);
IntegrationTests\ComponentRenderModeDirectiveIntegrationTests.cs (2)
169
var
diagnostic = Assert.Single(compilationResult.RazorDiagnostics);
184
var
diagnostic = Assert.Single(compilationResult.RazorDiagnostics);
IntegrationTests\ComponentTemplateIntegrationTest.cs (6)
25
var
diagnostic = Assert.Single(generated.RazorDiagnostics);
38
var
diagnostic = Assert.Single(generated.RazorDiagnostics);
87
var
diagnostic = Assert.Single(generated.RazorDiagnostics);
100
var
diagnostic = Assert.Single(generated.RazorDiagnostics);
114
var
diagnostic = Assert.Single(generated.RazorDiagnostics);
127
var
diagnostic = Assert.Single(generated.RazorDiagnostics);
Legacy\CSharpCodeParserTest.cs (11)
15
public static TheoryData<string, SourceLocation, IEnumerable<
RazorDiagnostic
>> InvalidTagHelperPrefixData
21
RazorDiagnostic
InvalidPrefixError(int length, char character, string prefix)
27
return new TheoryData<string, SourceLocation, IEnumerable<
RazorDiagnostic
>>
108
IEnumerable<
RazorDiagnostic
> expectedErrors)
112
var diagnostics = new List<
RazorDiagnostic
>();
136
var diagnostics = new List<
RazorDiagnostic
>();
168
var diagnostics = new List<
RazorDiagnostic
>();
169
var
expectedError = RazorDiagnosticFactory.CreateParsing_InvalidTagHelperLookupText(
178
var
error = Assert.Single(diagnostics);
186
var
expectedDiagnostic = RazorDiagnosticFactory.CreateParsing_DuplicateDirective(
207
var
diagnostic = Assert.Single(chunkGenerator.Diagnostics);
Legacy\TokenizerLookaheadTest.cs (1)
194
RazorDiagnostic
[] errors)
RazorDiagnosticTest.cs (36)
20
var
diagnostic =
RazorDiagnostic
.Create(descriptor, span);
36
var
diagnostic =
RazorDiagnostic
.Create(descriptor, span, "Hello", "World");
51
var
diagnostic =
RazorDiagnostic
.Create(descriptor, span, "error");
67
var
diagnostic =
RazorDiagnostic
.Create(descriptor, span, 1.3m);
84
var
diagnostic =
RazorDiagnostic
.Create(descriptor, span);
100
var
diagnostic =
RazorDiagnostic
.Create(descriptor, span, 1.3m);
116
var
diagnostic1 =
RazorDiagnostic
.Create(descriptor, span);
117
var
diagnostic2 =
RazorDiagnostic
.Create(descriptor, span);
134
var
diagnostic1 =
RazorDiagnostic
.Create(descriptor, span1);
135
var
diagnostic2 =
RazorDiagnostic
.Create(descriptor, span2);
152
var
diagnostic1 =
RazorDiagnostic
.Create(descriptor1, span);
153
var
diagnostic2 =
RazorDiagnostic
.Create(descriptor2, span);
169
var
diagnostic1 =
RazorDiagnostic
.Create(descriptor, span);
170
var
diagnostic2 =
RazorDiagnostic
.Create(descriptor, span);
187
var
diagnostic1 =
RazorDiagnostic
.Create(descriptor, span1);
188
var
diagnostic2 =
RazorDiagnostic
.Create(descriptor, span2);
205
var
diagnostic1 =
RazorDiagnostic
.Create(descriptor1, span);
206
var
diagnostic2 =
RazorDiagnostic
.Create(descriptor2, span);
Microsoft.AspNetCore.Razor.Test.Common (10)
DiagnosticExtensions.cs (1)
15
this IEnumerable<
RazorDiagnostic
> diagnostics,
Language\IntegrationTests\IntermediateNodeWriter.cs (1)
343
foreach (
var
diagnostic in node.Diagnostics)
Language\IntegrationTests\RazorDiagnosticSerializer.cs (1)
10
public static string Serialize(
RazorDiagnostic
diagnostic)
Language\IntegrationTests\RazorIntegrationTestBase.cs (1)
468
public required IEnumerable<
RazorDiagnostic
> RazorDiagnostics { get; set; }
Language\Legacy\ParserTestBase.cs (1)
170
protected static string SerializeDiagnostic(
RazorDiagnostic
diagnostic)
Language\TestBoundAttributeDescriptorBuilderExtensions.cs (1)
108
public static BoundAttributeDescriptorBuilder AddDiagnostic(this BoundAttributeDescriptorBuilder builder,
RazorDiagnostic
diagnostic)
Language\TestRazorCSharpDocument.cs (1)
16
ImmutableArray<
RazorDiagnostic
> diagnostics = default,
Language\TestRequiredAttributeDescriptorBuilderExtensions.cs (1)
59
this RequiredAttributeDescriptorBuilder builder,
RazorDiagnostic
diagnostic)
Language\TestTagHelperDescriptorBuilderExtensions.cs (1)
139
public static TagHelperDescriptorBuilder AddDiagnostic(this TagHelperDescriptorBuilder builder,
RazorDiagnostic
diagnostic)
Language\TestTagMatchingRuleDescriptorBuilderExtensions.cs (1)
48
public static TagMatchingRuleDescriptorBuilder AddDiagnostic(this TagMatchingRuleDescriptorBuilder builder,
RazorDiagnostic
diagnostic)
Microsoft.AspNetCore.Razor.Test.Common.Tooling (2)
Language\IntegrationTests\RazorToolingIntegrationTestBase.cs (1)
342
public IEnumerable<
RazorDiagnostic
> Diagnostics { get; set; }
Language\Legacy\ToolingParserTestBase.cs (1)
154
protected static string SerializeDiagnostic(
RazorDiagnostic
diagnostic)
Microsoft.CodeAnalysis.Razor.Compiler (572)
CSharp\DefaultTagHelperDescriptorFactory.cs (3)
231
var
diagnostic = RazorDiagnosticFactory.CreateTagHelper_InvalidAttributeNameNullOrEmpty(containingType.GetFullName(), property.Name);
284
var
diagnostic = RazorDiagnosticFactory.CreateTagHelper_InvalidAttributePrefixNotNull(containingType.GetFullName(), property.Name);
295
var
diagnostic = RazorDiagnosticFactory.CreateTagHelper_InvalidAttributePrefixNull(containingType.GetFullName(), property.Name);
CSharp\RazorDiagnosticFactory.cs (16)
41
public static
RazorDiagnostic
CreateTagHelper_InvalidAttributeNameNullOrEmpty(string tagHelperDisplayName, string propertyDisplayName)
42
=>
RazorDiagnostic
.Create(TagHelper_InvalidAttributeNameNullOrEmpty, tagHelperDisplayName, propertyDisplayName, TagHelperTypes.HtmlAttributeNameAttribute, TagHelperTypes.HtmlAttributeName.Name);
49
public static
RazorDiagnostic
CreateTagHelper_InvalidAttributePrefixNotNull(string tagHelperDisplayName, string propertyDisplayName)
50
=>
RazorDiagnostic
.Create(TagHelper_InvalidAttributePrefixNotNull, tagHelperDisplayName, propertyDisplayName, TagHelperTypes.HtmlAttributeNameAttribute, TagHelperTypes.HtmlAttributeName.DictionaryAttributePrefix, "IDictionary<string, TValue>");
57
public static
RazorDiagnostic
CreateTagHelper_InvalidAttributePrefixNull(string tagHelperDisplayName, string propertyDisplayName)
58
=>
RazorDiagnostic
.Create(TagHelper_InvalidAttributePrefixNull, tagHelperDisplayName, propertyDisplayName, TagHelperTypes.HtmlAttributeNameAttribute, TagHelperTypes.HtmlAttributeName.DictionaryAttributePrefix, "IDictionary<string, TValue>");
65
public static
RazorDiagnostic
CreateTagHelper_InvalidRequiredAttributeCharacter(char invalidCharacter, string requiredAttributes)
66
=>
RazorDiagnostic
.Create(TagHelper_InvalidRequiredAttributeCharacter, invalidCharacter, requiredAttributes);
73
public static
RazorDiagnostic
CreateTagHelper_PartialRequiredAttributeOperator(char partialOperator, string requiredAttributes)
74
=>
RazorDiagnostic
.Create(TagHelper_PartialRequiredAttributeOperator, requiredAttributes, partialOperator);
81
public static
RazorDiagnostic
CreateTagHelper_InvalidRequiredAttributeOperator(char invalidOperator, string requiredAttributes)
82
=>
RazorDiagnostic
.Create(TagHelper_InvalidRequiredAttributeOperator, invalidOperator, requiredAttributes);
89
public static
RazorDiagnostic
CreateTagHelper_InvalidRequiredAttributeMismatchedQuotes(char quote, string requiredAttributes)
90
=>
RazorDiagnostic
.Create(TagHelper_InvalidRequiredAttributeMismatchedQuotes, requiredAttributes, quote);
97
public static
RazorDiagnostic
CreateTagHelper_CouldNotFindMatchingEndBrace(string requiredAttributes)
98
=>
RazorDiagnostic
.Create(TagHelper_CouldNotFindMatchingEndBrace, requiredAttributes);
CSharp\RequiredAttributeParser.cs (3)
66
ImmutableArray<
RazorDiagnostic
> Diagnostics)
73
ReadOnlySpan<
RazorDiagnostic
> diagnostics)
87
private MemoryBuilder<
RazorDiagnostic
> _diagnostics = new();
Language\AllowedChildTagDescriptor.cs (1)
17
internal AllowedChildTagDescriptor(string name, string displayName, ImmutableArray<
RazorDiagnostic
> diagnostics)
Language\AllowedChildTagDescriptorBuilder.cs (4)
28
private protected override AllowedChildTagDescriptor BuildCore(ImmutableArray<
RazorDiagnostic
> diagnostics)
38
private protected override void CollectDiagnostics(ref PooledHashSet<
RazorDiagnostic
> diagnostics)
42
var
diagnostic = RazorDiagnosticFactory.CreateTagHelper_InvalidRestrictedChildNullOrWhitespace(_parent.GetDisplayName());
52
var
diagnostic = RazorDiagnosticFactory.CreateTagHelper_InvalidRestrictedChild(_parent.GetDisplayName(), Name, character);
Language\BoundAttributeDescriptor.cs (4)
62
ImmutableArray<
RazorDiagnostic
> diagnostics)
116
public IEnumerable<
RazorDiagnostic
> GetAllDiagnostics()
120
foreach (
var
diagnostic in parameter.Diagnostics)
126
foreach (
var
diagnostic in Diagnostics)
Language\BoundAttributeDescriptorBuilder.cs (10)
153
private protected override BoundAttributeDescriptor BuildCore(ImmutableArray<
RazorDiagnostic
> diagnostics)
196
private protected override void CollectDiagnostics(ref PooledHashSet<
RazorDiagnostic
> diagnostics)
207
var
diagnostic = RazorDiagnosticFactory.CreateTagHelper_InvalidBoundAttributeNullOrWhitespace(
218
var
diagnostic = RazorDiagnosticFactory.CreateTagHelper_InvalidBoundAttributeNameStartsWith(
233
var
diagnostic = RazorDiagnosticFactory.CreateTagHelper_InvalidBoundDirectiveAttributeName(
245
var
diagnostic = RazorDiagnosticFactory.CreateTagHelper_InvalidBoundAttributeName(
260
var
diagnostic = RazorDiagnosticFactory.CreateTagHelper_InvalidBoundAttributePrefixStartsWith(
269
var
diagnostic = RazorDiagnosticFactory.CreateTagHelper_InvalidBoundAttributeNullOrWhitespace(
284
var
diagnostic = RazorDiagnosticFactory.CreateTagHelper_InvalidBoundDirectiveAttributePrefix(
296
var
diagnostic = RazorDiagnosticFactory.CreateTagHelper_InvalidBoundAttributePrefix(
Language\BoundAttributeParameterDescriptor.cs (1)
39
ImmutableArray<
RazorDiagnostic
> diagnostics)
Language\BoundAttributeParameterDescriptorBuilder.cs (4)
67
private protected override BoundAttributeParameterDescriptor BuildCore(ImmutableArray<
RazorDiagnostic
> diagnostics)
85
private protected override void CollectDiagnostics(ref PooledHashSet<
RazorDiagnostic
> diagnostics)
89
var
diagnostic = RazorDiagnosticFactory.CreateTagHelper_InvalidBoundAttributeParameterNullOrWhitespace(_parent.Name);
99
var
diagnostic = RazorDiagnosticFactory.CreateTagHelper_InvalidBoundAttributeParameterName(
Language\CodeGeneration\CodeRenderingContext.cs (8)
25
private readonly ImmutableArray<
RazorDiagnostic
>.Builder _diagnostics;
53
_diagnostics = ArrayBuilderPool<
RazorDiagnostic
>.Default.Get();
55
foreach (
var
diagnostic in _documentNode.GetAllDiagnostics())
71
ArrayBuilderPool<
RazorDiagnostic
>.Default.Return(_diagnostics);
89
public void AddDiagnostic(
RazorDiagnostic
diagnostic)
94
public ImmutableArray<
RazorDiagnostic
> GetDiagnostics()
100
using var filtered = new PooledArrayBuilder<
RazorDiagnostic
>(capacity: _diagnostics.Count);
101
foreach (
var
diagnostic in _diagnostics)
Language\Components\ComponentDiagnosticFactory.cs (86)
23
public static
RazorDiagnostic
Create_UnsupportedTagHelperDirective(SourceSpan? source)
24
=>
RazorDiagnostic
.Create(UnsupportedTagHelperDirective, source);
33
public static
RazorDiagnostic
Create_CodeBlockInAttribute(SourceSpan? source, string expression)
34
=>
RazorDiagnostic
.Create(CodeBlockInAttribute, source, expression);
41
public static
RazorDiagnostic
Create_UnclosedTag(SourceSpan? span, string tagName)
42
=>
RazorDiagnostic
.Create(UnclosedTag, span, tagName);
49
public static
RazorDiagnostic
Create_UnexpectedClosingTag(SourceSpan? span, string tagName)
50
=>
RazorDiagnostic
.Create(UnexpectedClosingTag, span, tagName);
57
public static
RazorDiagnostic
Create_UnexpectedClosingTagForVoidElement(SourceSpan? span, string tagName)
58
=>
RazorDiagnostic
.Create(UnexpectedClosingTagForVoidElement, span, tagName);
65
public static
RazorDiagnostic
Create_InvalidHtmlContent(SourceSpan? span, string text)
66
=>
RazorDiagnostic
.Create(InvalidHtmlContent, span, text);
73
public static
RazorDiagnostic
Create_MultipleComponents(SourceSpan? span, string tagName, IEnumerable<TagHelperDescriptor> components)
76
return
RazorDiagnostic
.Create(MultipleComponents, span, tagName, componentNames);
86
public static
RazorDiagnostic
Create_AmbiguousComponentSelection(SourceSpan? span, string tagName, TagHelperDescriptor genericComponent, TagHelperDescriptor nonGenericComponent)
89
return
RazorDiagnostic
.Create(AmbiguousComponentSelection, span, tagName, componentNames);
97
public static
RazorDiagnostic
Create_UnsupportedComplexContent(IntermediateNode node, string attributeName)
100
return
RazorDiagnostic
.Create(UnsupportedComplexContent, node.Source, attributeName, content);
108
public static
RazorDiagnostic
CreatePageDirective_CannotBeImported(SourceSpan source)
112
return
RazorDiagnostic
.Create(PageDirective_CannotBeImported, source, "page", fileName);
120
public static
RazorDiagnostic
CreatePageDirective_MustSpecifyRoute(SourceSpan? source)
121
=>
RazorDiagnostic
.Create(PageDirective_MustSpecifyRoute, source);
128
public static
RazorDiagnostic
CreateBindAttribute_Duplicates(
130
=>
RazorDiagnostic
.Create(
141
public static
RazorDiagnostic
CreateEventHandler_Duplicates(SourceSpan? source, string attribute, TagHelperDirectiveAttributeIntermediateNode[] attributes)
142
=>
RazorDiagnostic
.Create(
154
public static
RazorDiagnostic
CreateBindAttribute_InvalidSyntax(SourceSpan? source, string attribute)
155
=>
RazorDiagnostic
.Create(BindAttribute_InvalidSyntax, source, attribute);
164
public static
RazorDiagnostic
Create_DisallowedScriptTag(SourceSpan? source)
165
=>
RazorDiagnostic
.Create(DisallowedScriptTag, source);
172
public static
RazorDiagnostic
Create_TemplateInvalidLocation(SourceSpan? source)
173
=>
RazorDiagnostic
.Create(TemplateInvalidLocation, source);
180
public static
RazorDiagnostic
Create_ChildContentSetByAttributeAndBody(SourceSpan? source, string attribute)
181
=>
RazorDiagnostic
.Create(ChildContentSetByAttributeAndBody, source, attribute);
189
public static
RazorDiagnostic
Create_ChildContentMixedWithExplicitChildContent(SourceSpan? source, ComponentIntermediateNode component)
193
return
RazorDiagnostic
.Create(ChildContentMixedWithExplicitChildContent, source, component.TagName, supportedElements);
201
public static
RazorDiagnostic
Create_ChildContentHasInvalidAttribute(SourceSpan? source, string attribute, string element)
202
=>
RazorDiagnostic
.Create(ChildContentHasInvalidAttribute, source, attribute, element);
209
public static
RazorDiagnostic
Create_ChildContentHasInvalidParameter(SourceSpan? source, string attribute, string element)
210
=>
RazorDiagnostic
.Create(ChildContentHasInvalidParameter, source, attribute, element);
218
public static
RazorDiagnostic
Create_ChildContentRepeatedParameterName(
229
return
RazorDiagnostic
.Create(
244
public static
RazorDiagnostic
Create_GenericComponentMissingTypeArgument(
252
return
RazorDiagnostic
.Create(GenericComponentMissingTypeArgument, source, component.TagName, attributesText);
261
public static
RazorDiagnostic
Create_GenericComponentTypeInferenceUnderspecified(
269
return
RazorDiagnostic
.Create(GenericComponentTypeInferenceUnderspecified, source, component.TagName, attributesText);
277
public static
RazorDiagnostic
Create_ChildContentHasInvalidParameterOnComponent(SourceSpan? source, string attribute, string element)
278
=>
RazorDiagnostic
.Create(ChildContentHasInvalidParameterOnComponent, source, attribute, element);
285
public static
RazorDiagnostic
Create_UnsupportedComponentImportContent(SourceSpan? source)
286
=>
RazorDiagnostic
.Create(UnsupportedComponentImportContent, source);
293
public static
RazorDiagnostic
CreateBindAttributeParameter_MissingBind(SourceSpan? source, string attribute)
294
=>
RazorDiagnostic
.Create(
304
public static
RazorDiagnostic
Create_DuplicateMarkupAttribute(string attributeName, SourceSpan? source = null)
305
=>
RazorDiagnostic
.Create(DuplicateMarkupAttribute, source, attributeName);
313
public static
RazorDiagnostic
Create_DuplicateMarkupAttributeDirective(string attributeName, string directiveAttributeName, SourceSpan? source = null)
314
=>
RazorDiagnostic
.Create(DuplicateMarkupAttributeDirective, source, attributeName, directiveAttributeName);
321
public static
RazorDiagnostic
Create_DuplicateComponentParameter(string attributeName, SourceSpan? source = null)
322
=>
RazorDiagnostic
.Create(DuplicateComponentParameter, source, attributeName);
330
public static
RazorDiagnostic
Create_DuplicateComponentParameterDirective(string attributeName, string directiveAttributeName, SourceSpan? source = null)
331
=>
RazorDiagnostic
.Create(DuplicateComponentParameterDirective, source, attributeName, directiveAttributeName);
338
public static
RazorDiagnostic
Create_ComponentNamesCannotStartWithLowerCase(string componentName, SourceSpan? source = null)
339
=>
RazorDiagnostic
.Create(ComponentNamesCannotStartWithLowerCase, source, componentName);
346
public static
RazorDiagnostic
Create_UnexpectedMarkupElement(string elementName, SourceSpan? source = null)
347
=>
RazorDiagnostic
.Create(UnexpectedMarkupElement, source, elementName);
354
public static
RazorDiagnostic
Create_InconsistentStartAndEndTagName(string startTagName, string endTagName, SourceSpan? source = null)
355
=>
RazorDiagnostic
.Create(InconsistentStartAndEndTagName, source, startTagName, endTagName);
362
public static
RazorDiagnostic
CreateEventHandlerParameter_Duplicates(SourceSpan? source, string attribute, TagHelperDirectiveAttributeParameterIntermediateNode[] attributes)
363
=>
RazorDiagnostic
.Create(
374
public static
RazorDiagnostic
CreateBindAttributeParameter_UseBindGet(SourceSpan? source, string attribute)
375
=>
RazorDiagnostic
.Create(BindAttributeParameter_UseBindGet, source, attribute);
383
public static
RazorDiagnostic
CreateBindAttributeParameter_MissingBindGet(SourceSpan? source, string attribute)
384
=>
RazorDiagnostic
.Create(BindAttributeParameter_MissingBindGet, source, attribute);
391
public static
RazorDiagnostic
CreateBindAttribute_MissingBindSet(SourceSpan? source, string attributeGet, string attributeSet)
392
=>
RazorDiagnostic
.Create(BindAttribute_MissingBindSet, source, attributeGet, attributeSet);
399
public static
RazorDiagnostic
CreateBindAttributeParameter_InvalidSyntaxBindAndBindGet(SourceSpan? source, string attribute)
400
=>
RazorDiagnostic
.Create(BindAttributeParameter_InvalidSyntaxBindAndBindGet, source, attribute);
407
public static
RazorDiagnostic
CreateBindAttributeParameter_InvalidSyntaxBindSetAfter(SourceSpan? source, string attribute)
408
=>
RazorDiagnostic
.Create(BindAttributeParameter_InvalidSyntaxBindSetAfter, source, attribute);
415
public static
RazorDiagnostic
CreateBindAttributeParameter_UnsupportedSyntaxBindGetSet(SourceSpan? source, string attribute)
416
=>
RazorDiagnostic
.Create(BindAttributeParameter_UnsupportedSyntaxBindGetSet, source, attribute);
425
public static
RazorDiagnostic
CreateFormName_NotAForm(SourceSpan? source)
426
=>
RazorDiagnostic
.Create(FormName_NotAForm, source);
433
public static
RazorDiagnostic
CreateAttribute_ValidOnlyOnComponent(SourceSpan? source, string attribute)
434
=>
RazorDiagnostic
.Create(Attribute_ValidOnlyOnComponent, source, attribute);
441
public static
RazorDiagnostic
CreateRenderModeAttribute_ComponentDeclaredRenderMode(SourceSpan? source, string component)
443
return
RazorDiagnostic
.Create(RenderModeAttribute_ComponentDeclaredRenderMode, source, component);
Language\Components\ComponentLoweringPass.cs (1)
133
foreach (
var
diagnostic in node.Diagnostics)
Language\DefaultDirectiveSyntaxTreePass.cs (2)
37
private ImmutableArray<
RazorDiagnostic
>.Builder? _diagnostics;
85
var
error = RazorDiagnosticFactory.CreateParsing_SectionsCannotBeNested(new SourceSpan(directiveStart, errorLength));
Language\DefaultRazorIntermediateNodeLoweringPhase.cs (3)
140
foreach (
var
diagnostic in syntaxTree.Diagnostics)
147
foreach (
var
diagnostic in import.Diagnostics)
2226
private static bool IsMalformed(IEnumerable<
RazorDiagnostic
> diagnostics)
Language\DefaultTagHelperResolutionPhase.cs (2)
76
using var descriptorDiagnostics = new PooledArrayBuilder<
RazorDiagnostic
>();
82
foreach (
var
diagnostic in descriptorDiagnostics)
Language\Extensions\DefaultTagHelperTargetExtension.cs (2)
549
var
diagnostic = RazorDiagnosticFactory.CreateTagHelper_CodeBlocksNotSupportedInAttributes(span);
555
var
diagnostic = RazorDiagnosticFactory.CreateTagHelper_InlineMarkupBlocksNotSupportedInAttributes(span, expectedTypeName);
Language\Intermediate\IntermediateNode.cs (6)
14
private ImmutableArray<
RazorDiagnostic
>.Builder? _diagnosticsBuilder;
15
private ImmutableArray<
RazorDiagnostic
>? _diagnostics;
17
public ImmutableArray<
RazorDiagnostic
> Diagnostics
30
public void AddDiagnostic(
RazorDiagnostic
diagnostic)
32
_diagnosticsBuilder ??= ImmutableArray.CreateBuilder<
RazorDiagnostic
>();
41
_diagnosticsBuilder ??= ImmutableArray.CreateBuilder<
RazorDiagnostic
>();
Language\Intermediate\IntermediateNodeExtensions.cs (3)
11
public static ImmutableArray<
RazorDiagnostic
> GetAllDiagnostics(this IntermediateNode node)
15
var diagnostics = new PooledHashSet<
RazorDiagnostic
>();
27
static void CollectDiagnostics(IntermediateNode node, ref PooledHashSet<
RazorDiagnostic
> diagnostics)
Language\Legacy\AddTagHelperChunkGenerator.cs (2)
21
List<
RazorDiagnostic
> diagnostics)
38
public List<
RazorDiagnostic
> Diagnostics { get; }
Language\Legacy\CSharpCodeParser.cs (6)
353
var
diagnostic = RazorDiagnosticFactory.CreateParsing_HelperDirectiveNotAvailable(
1223
RazorDiagnostic
? duplicateDiagnostic = null;
1312
Func<string, List<
RazorDiagnostic
>, SourceLocation, ISpanChunkGenerator> chunkGeneratorFactory)
1398
List<
RazorDiagnostic
> errors)
1453
internal static ParsedDirective ParseAddOrRemoveDirective(ParsedDirective directive, SourceLocation directiveLocation, List<
RazorDiagnostic
> errors)
1508
List<
RazorDiagnostic
> diagnostics)
Language\Legacy\ErrorSink.cs (8)
11
/// Used to manage <see cref="
RazorDiagnostic
">RazorDiagnostics</see> encountered during the Razor parsing phase.
15
private ImmutableArray<
RazorDiagnostic
>.Builder? _errors;
23
ArrayBuilderPool<
RazorDiagnostic
>.Default.Return(errors);
28
public ImmutableArray<
RazorDiagnostic
> GetErrorsAndClear()
37
ArrayBuilderPool<
RazorDiagnostic
>.Default.Return(errors);
46
/// <param name="error">The <see cref="
RazorDiagnostic
"/> to track.</param>
47
public void OnError(
RazorDiagnostic
error)
49
var errors = _errors ??= ArrayBuilderPool<
RazorDiagnostic
>.Default.Get();
Language\Legacy\HtmlLanguageCharacteristics.cs (1)
119
protected override SyntaxToken CreateToken(string content, SyntaxKind kind,
RazorDiagnostic
[] errors)
Language\Legacy\HtmlMarkupParser.cs (1)
106
return SyntaxFactory.RazorDocument(markup, SyntaxFactory.Token(SyntaxKind.EndOfFile, "", Array.Empty<
RazorDiagnostic
>()));
Language\Legacy\HtmlTokenizer.cs (1)
48
protected override SyntaxToken CreateToken(string content, SyntaxKind type,
RazorDiagnostic
[] errors)
Language\Legacy\LanguageCharacteristics.cs (2)
90
var left = CreateToken(token.Content.Substring(0, splitAt), leftType, Array.Empty<
RazorDiagnostic
>());
108
protected abstract SyntaxToken CreateToken(string content, SyntaxKind type,
RazorDiagnostic
[] errors);
Language\Legacy\NativeCSharpLanguageCharacteristics.cs (1)
81
protected override SyntaxToken CreateToken(string content, SyntaxKind kind,
RazorDiagnostic
[] errors)
Language\Legacy\NativeCSharpTokenizer.cs (1)
356
protected override SyntaxToken CreateToken(string content, SyntaxKind kind,
RazorDiagnostic
[] errors)
Language\Legacy\RemoveTagHelperChunkGenerator.cs (2)
21
List<
RazorDiagnostic
> diagnostics)
38
public List<
RazorDiagnostic
> Diagnostics { get; }
Language\Legacy\RoslynCSharpLanguageCharacteristics.cs (1)
73
protected override SyntaxToken CreateToken(string content, SyntaxKind kind,
RazorDiagnostic
[] errors)
Language\Legacy\RoslynCSharpTokenizer.cs (1)
212
protected override SyntaxToken CreateToken(string content, SyntaxKind kind,
RazorDiagnostic
[] errors)
Language\Legacy\TagHelperBlockRewriter.cs (4)
114
var
diagnostic = RazorDiagnosticFactory.CreateParsing_TagHelpersCannotHaveCSharpInTagDeclaration(location, tagName);
127
var
diagnostic = RazorDiagnosticFactory.CreateParsing_TagHelperAttributeListMustBeWellFormed(location);
192
var
diagnostic = RazorDiagnosticFactory.CreateTagHelper_EmptyBoundAttribute(errorLocation, result.AttributeName, tagName, propertyTypeName);
201
var
diagnostic = RazorDiagnosticFactory.CreateParsing_TagHelperIndexerAttributeNameMustIncludeKey(errorLocation, result.AttributeName, tagName);
Language\Legacy\TagHelperParseTreeRewriter.cs (1)
39
using var builder = new PooledArrayBuilder<
RazorDiagnostic
>(capacity: treeDiagnostics.Length + sinkDiagnostics.Length);
Language\Legacy\TagHelperPrefixDirectiveChunkGenerator.cs (2)
16
public TagHelperPrefixDirectiveChunkGenerator(string prefix, string directiveText, List<
RazorDiagnostic
> diagnostics)
27
public List<
RazorDiagnostic
> Diagnostics { get; }
Language\Legacy\Tokenizer.cs (5)
23
CurrentErrors = new List<
RazorDiagnostic
>();
27
protected List<
RazorDiagnostic
> CurrentErrors { get; }
66
protected abstract SyntaxToken CreateToken(string content, SyntaxKind type,
RazorDiagnostic
[] errors);
220
var errors = CurrentErrors.Count == 0 ? Array.Empty<
RazorDiagnostic
>() : new
RazorDiagnostic
[CurrentErrors.Count];
Language\Legacy\TokenizerBackedParser.cs (3)
384
var
diagnostic = RazorDiagnosticFactory.CreateParsing_RazorCommentNotTerminated(
394
var
diagnostic = RazorDiagnosticFactory.CreateParsing_RazorCommentNotTerminated(
535
foreach (
var
error in token.GetDiagnostics())
Language\RazorCSharpDocument.cs (2)
15
public ImmutableArray<
RazorDiagnostic
> Diagnostics { get; }
23
ImmutableArray<
RazorDiagnostic
> diagnostics,
Language\RazorDiagnostic.cs (8)
10
public sealed class RazorDiagnostic : IEquatable<
RazorDiagnostic
>, IFormattable
29
public static
RazorDiagnostic
Create(RazorDiagnosticDescriptor descriptor)
32
public static
RazorDiagnostic
Create(RazorDiagnosticDescriptor descriptor, SourceSpan? span)
35
public static
RazorDiagnostic
Create(RazorDiagnosticDescriptor descriptor, params object[] args)
38
public static
RazorDiagnostic
Create(RazorDiagnosticDescriptor descriptor, SourceSpan? span, params object[] args)
95
=> obj is
RazorDiagnostic
diagnostic &&
98
public bool Equals(
RazorDiagnostic
? other)
113
private static string Format(
RazorDiagnostic
diagnostic, IFormatProvider? formatProvider)
Language\RazorDiagnosticFactory.cs (160)
22
public static
RazorDiagnostic
CreateDirective_BlockDirectiveCannotBeImported(string directive)
23
=>
RazorDiagnostic
.Create(Directive_BlockDirectiveCannotBeImported, directive);
36
public static
RazorDiagnostic
CreateParsing_UnterminatedStringLiteral(SourceSpan location)
37
=>
RazorDiagnostic
.Create(Parsing_UnterminatedStringLiteral, location);
44
public static
RazorDiagnostic
CreateParsing_BlockCommentNotTerminated(SourceSpan location)
45
=>
RazorDiagnostic
.Create(Parsing_BlockCommentNotTerminated, location);
52
public static
RazorDiagnostic
CreateParsing_HelperDirectiveNotAvailable(SourceSpan location)
53
=>
RazorDiagnostic
.Create(Parsing_HelperDirectiveNotAvailable, location, SyntaxConstants.CSharp.HelperKeyword);
60
public static
RazorDiagnostic
CreateParsing_UnexpectedWhiteSpaceAtStartOfCodeBlock(SourceSpan location)
61
=>
RazorDiagnostic
.Create(Parsing_UnexpectedWhiteSpaceAtStartOfCodeBlock, location);
68
public static
RazorDiagnostic
CreateParsing_UnexpectedEndOfFileAtStartOfCodeBlock(SourceSpan location)
69
=>
RazorDiagnostic
.Create(Parsing_UnexpectedEndOfFileAtStartOfCodeBlock, location);
76
public static
RazorDiagnostic
CreateParsing_UnexpectedCharacterAtStartOfCodeBlock(SourceSpan location, string content)
77
=>
RazorDiagnostic
.Create(Parsing_UnexpectedCharacterAtStartOfCodeBlock, location, content);
84
public static
RazorDiagnostic
CreateParsing_ExpectedEndOfBlockBeforeEOF(SourceSpan location, string blockName, string closeBlock, string openBlock)
85
=>
RazorDiagnostic
.Create(Parsing_ExpectedEndOfBlockBeforeEOF, location, blockName, closeBlock, openBlock);
92
public static
RazorDiagnostic
CreateParsing_ReservedWord(SourceSpan location, string content)
93
=>
RazorDiagnostic
.Create(Parsing_ReservedWord, location, content);
100
public static
RazorDiagnostic
CreateParsing_SingleLineControlFlowStatementsCannotContainMarkup(SourceSpan location)
101
=>
RazorDiagnostic
.Create(Parsing_SingleLineControlFlowStatementsNotAllowed, location);
108
public static
RazorDiagnostic
CreateParsing_AtInCodeMustBeFollowedByColonParenOrIdentifierStart(SourceSpan location)
109
=>
RazorDiagnostic
.Create(Parsing_AtInCodeMustBeFollowedByColonParenOrIdentifierStart, location);
116
public static
RazorDiagnostic
CreateParsing_UnexpectedNestedCodeBlock(SourceSpan location)
117
=>
RazorDiagnostic
.Create(Parsing_UnexpectedNestedCodeBlock, location);
124
public static
RazorDiagnostic
CreateParsing_DirectiveTokensMustBeSeparatedByWhitespace(SourceSpan location, string directiveName)
125
=>
RazorDiagnostic
.Create(Parsing_DirectiveTokensMustBeSeparatedByWhitespace, location, directiveName);
132
public static
RazorDiagnostic
CreateParsing_UnexpectedEOFAfterDirective(SourceSpan location, string directiveName, string expectedToken)
133
=>
RazorDiagnostic
.Create(Parsing_UnexpectedEOFAfterDirective, location, directiveName, expectedToken);
140
public static
RazorDiagnostic
CreateParsing_DirectiveExpectsTypeName(SourceSpan location, string directiveName)
141
=>
RazorDiagnostic
.Create(Parsing_DirectiveExpectsTypeName, location, directiveName);
148
public static
RazorDiagnostic
CreateParsing_DirectiveExpectsNamespace(SourceSpan location, string directiveName)
149
=>
RazorDiagnostic
.Create(Parsing_DirectiveExpectsNamespace, location, directiveName);
156
public static
RazorDiagnostic
CreateParsing_DirectiveExpectsIdentifier(SourceSpan location, string directiveName)
157
=>
RazorDiagnostic
.Create(Parsing_DirectiveExpectsIdentifier, location, directiveName);
164
public static
RazorDiagnostic
CreateParsing_DirectiveExpectsQuotedStringLiteral(SourceSpan location, string directiveName)
165
=>
RazorDiagnostic
.Create(Parsing_DirectiveExpectsQuotedStringLiteral, location, directiveName);
172
public static
RazorDiagnostic
CreateParsing_UnexpectedDirectiveLiteral(SourceSpan location, string directiveName, string expected)
173
=>
RazorDiagnostic
.Create(Parsing_UnexpectedDirectiveLiteral, location, directiveName, expected);
180
public static
RazorDiagnostic
CreateParsing_DirectiveMustHaveValue(SourceSpan location, string directiveName)
181
=>
RazorDiagnostic
.Create(Parsing_DirectiveMustHaveValue, location, directiveName);
188
public static
RazorDiagnostic
CreateParsing_IncompleteQuotesAroundDirective(SourceSpan location, string directiveName)
189
=>
RazorDiagnostic
.Create(Parsing_IncompleteQuotesAroundDirective, location, directiveName);
196
public static
RazorDiagnostic
CreateParsing_InvalidTagHelperPrefixValue(SourceSpan location, string directiveName, char character, string prefix)
197
=>
RazorDiagnostic
.Create(Parsing_InvalidTagHelperPrefixValue, location, directiveName, character, prefix);
204
public static
RazorDiagnostic
CreateParsing_MarkupBlockMustStartWithTag(SourceSpan location)
205
=>
RazorDiagnostic
.Create(Parsing_MarkupBlockMustStartWithTag, location);
212
public static
RazorDiagnostic
CreateParsing_OuterTagMissingName(SourceSpan location)
213
=>
RazorDiagnostic
.Create(Parsing_OuterTagMissingName, location);
220
public static
RazorDiagnostic
CreateParsing_TextTagCannotContainAttributes(SourceSpan location)
221
=>
RazorDiagnostic
.Create(Parsing_TextTagCannotContainAttributes, location);
228
public static
RazorDiagnostic
CreateParsing_UnfinishedTag(SourceSpan location, string tagName)
229
=>
RazorDiagnostic
.Create(Parsing_UnfinishedTag, location, tagName);
236
public static
RazorDiagnostic
CreateParsing_MissingEndTag(SourceSpan location, string tagName)
237
=>
RazorDiagnostic
.Create(Parsing_MissingEndTag, location, tagName);
244
public static
RazorDiagnostic
CreateParsing_UnexpectedEndTag(SourceSpan location, string tagName)
245
=>
RazorDiagnostic
.Create(Parsing_UnexpectedEndTag, location, tagName);
252
public static
RazorDiagnostic
CreateParsing_ExpectedCloseBracketBeforeEOF(SourceSpan location, string openBrace, string closeBrace)
253
=>
RazorDiagnostic
.Create(Parsing_ExpectedCloseBracketBeforeEOF, location, openBrace, closeBrace);
260
public static
RazorDiagnostic
CreateParsing_RazorCommentNotTerminated(SourceSpan location)
261
=>
RazorDiagnostic
.Create(Parsing_RazorCommentNotTerminated, location);
268
public static
RazorDiagnostic
CreateParsing_TagHelperIndexerAttributeNameMustIncludeKey(SourceSpan location, string attributeName, string tagName)
269
=>
RazorDiagnostic
.Create(Parsing_TagHelperIndexerAttributeNameMustIncludeKey, location, attributeName, tagName);
276
public static
RazorDiagnostic
CreateParsing_TagHelperAttributeListMustBeWellFormed(SourceSpan location)
277
=>
RazorDiagnostic
.Create(Parsing_TagHelperAttributeListMustBeWellFormed, location);
284
public static
RazorDiagnostic
CreateParsing_TagHelpersCannotHaveCSharpInTagDeclaration(SourceSpan location, string tagName)
285
=>
RazorDiagnostic
.Create(Parsing_TagHelpersCannotHaveCSharpInTagDeclaration, location, tagName);
292
public static
RazorDiagnostic
CreateParsing_TagHelperAttributesMustHaveAName(SourceSpan location, string tagName)
293
=>
RazorDiagnostic
.Create(Parsing_TagHelperAttributesMustHaveAName, location, tagName);
300
public static
RazorDiagnostic
CreateParsing_TagHelperMustNotHaveAnEndTag(SourceSpan location, string tagName, string displayName, TagStructure tagStructure)
301
=>
RazorDiagnostic
.Create(Parsing_TagHelperMustNotHaveAnEndTag, location, tagName, displayName, tagStructure);
308
public static
RazorDiagnostic
CreateParsing_TagHelperFoundMalformedTagHelper(SourceSpan location, string tagName)
309
=>
RazorDiagnostic
.Create(Parsing_TagHelperFoundMalformedTagHelper, location, tagName);
316
public static
RazorDiagnostic
CreateParsing_TagHelperMissingCloseAngle(SourceSpan location, string tagName)
317
=>
RazorDiagnostic
.Create(Parsing_TagHelperMissingCloseAngle, location, tagName);
324
public static
RazorDiagnostic
CreateParsing_InvalidTagHelperLookupText(SourceSpan location, string lookupText)
325
=>
RazorDiagnostic
.Create(Parsing_InvalidTagHelperLookupText, location, lookupText);
332
public static
RazorDiagnostic
CreateParsing_DirectiveExpectsCSharpAttribute(SourceSpan location, string directiveName)
333
=>
RazorDiagnostic
.Create(Parsing_DirectiveExpectsCSharpAttribute, location, directiveName);
340
public static
RazorDiagnostic
CreateParsing_DirectiveExpectsBooleanLiteral(SourceSpan location, string directiveName)
341
=>
RazorDiagnostic
.Create(Parsing_DirectiveExpectsBooleanLiteral, location, directiveName);
348
public static
RazorDiagnostic
CreateParsing_GenericTypeParameterIdentifierMismatch(SourceSpan location, string directiveName, string constraintIdentifier, string originalMember)
349
=>
RazorDiagnostic
.Create(Parsing_GenericTypeParameterIdentifierMismatch, location, directiveName, constraintIdentifier, originalMember);
356
public static
RazorDiagnostic
CreateParsing_UnexpectedIdentifier(SourceSpan location, string content, params string[] options)
357
=>
RazorDiagnostic
.Create(Parsing_UnexpectedIdentifier, location, content, string.Join(", ", options));
364
public static
RazorDiagnostic
CreateParsing_DirectiveExpectsIdentifierOrExpression(SourceSpan location, string directiveName)
365
=>
RazorDiagnostic
.Create(Parsing_DirectiveExpectsIdentifierOrExpression, location, directiveName);
372
public static
RazorDiagnostic
CreateParsing_VoidElement(SourceSpan location, string tagName)
373
=>
RazorDiagnostic
.Create(Parsing_VoidElement, location, tagName);
380
public static
RazorDiagnostic
CreateParsing_PreprocessorDirectivesMustBeAtTheStartOfLine(SourceSpan location)
381
=>
RazorDiagnostic
.Create(Parsing_PreprocessorDirectivesMustBeAtTheStartOfLine, location);
388
public static
RazorDiagnostic
CreateParsing_PossibleMisplacedPreprocessorDirective(SourceSpan location)
389
=>
RazorDiagnostic
.Create(Parsing_PossibleMisplacedPreprocessorDirective, location);
396
public static
RazorDiagnostic
CreateParsing_DefineAndUndefNotAllowed(SourceSpan location)
397
=>
RazorDiagnostic
.Create(Parsing_DefineAndUndefNotAllowed, location);
410
public static
RazorDiagnostic
CreateCodeTarget_UnsupportedExtension(string documentKind, Type extensionType)
411
=>
RazorDiagnostic
.Create(CodeTarget_UnsupportedExtension, documentKind, extensionType.Name);
418
public static
RazorDiagnostic
CreateParsing_DuplicateDirective(SourceSpan location, string directive)
419
=>
RazorDiagnostic
.Create(Parsing_DuplicateDirective, location, directive);
426
public static
RazorDiagnostic
CreateParsing_SectionsCannotBeNested(SourceSpan location)
427
=>
RazorDiagnostic
.Create(Parsing_SectionsCannotBeNested, location, Resources.SectionExample);
434
public static
RazorDiagnostic
CreateParsing_InlineMarkupBlocksCannotBeNested(SourceSpan location)
435
=>
RazorDiagnostic
.Create(Parsing_InlineMarkupBlocksCannotBeNested, location);
442
public static
RazorDiagnostic
CreateParsing_NamespaceImportAndTypeAliasCannotExistWithinCodeBlock(SourceSpan location)
443
=>
RazorDiagnostic
.Create(Parsing_NamespaceImportAndTypeAliasCannotExistWithinCodeBlock, location);
450
public static
RazorDiagnostic
CreateParsing_DirectiveMustAppearAtStartOfLine(SourceSpan location, string directiveName)
451
=>
RazorDiagnostic
.Create(Parsing_DirectiveMustAppearAtStartOfLine, location, directiveName);
458
public static
RazorDiagnostic
CreateTagHelper_CodeBlocksNotSupportedInAttributes(SourceSpan? location)
459
=>
RazorDiagnostic
.Create(TagHelper_CodeBlocksNotSupportedInAttributes, location);
466
public static
RazorDiagnostic
CreateTagHelper_InlineMarkupBlocksNotSupportedInAttributes(SourceSpan? location, string expectedTypeName)
467
=>
RazorDiagnostic
.Create(TagHelper_InlineMarkupBlocksNotSupportedInAttributes, location, expectedTypeName);
474
public static
RazorDiagnostic
CreateTagHelper_EmptyBoundAttribute(SourceSpan location, string attributeName, string tagName, string propertyTypeName)
475
=>
RazorDiagnostic
.Create(TagHelper_EmptyBoundAttribute, location, attributeName, tagName, propertyTypeName);
482
public static
RazorDiagnostic
CreateTagHelper_CannotHaveNonTagContent(SourceSpan location, string tagName, string allowedChildren)
483
=>
RazorDiagnostic
.Create(TagHelper_CannotHaveNonTagContent, location, tagName, allowedChildren);
490
public static
RazorDiagnostic
CreateTagHelper_InvalidNestedTag(SourceSpan location, string tagName, string parent, string allowedChildren)
491
=>
RazorDiagnostic
.Create(TagHelper_InvalidNestedTag, location, tagName, parent, allowedChildren);
498
public static
RazorDiagnostic
CreateTagHelper_InconsistentTagStructure(SourceSpan location, string firstDescriptor, string secondDescriptor, string tagName)
499
=>
RazorDiagnostic
.Create(
512
public static
RazorDiagnostic
CreateComponent_EditorRequiredParameterNotSpecified(SourceSpan? location, string tagName, string parameterName)
513
=>
RazorDiagnostic
.Create(Component_EditorRequiredParameterNotSpecified, location, tagName, parameterName);
526
public static
RazorDiagnostic
CreateTagHelper_InvalidRestrictedChildNullOrWhitespace(string tagHelperDisplayName)
527
=>
RazorDiagnostic
.Create(TagHelper_InvalidRestrictedChildNullOrWhitespace, tagHelperDisplayName);
534
public static
RazorDiagnostic
CreateTagHelper_InvalidRestrictedChild(string tagHelperDisplayName, string restrictedChild, char invalidCharacter)
535
=>
RazorDiagnostic
.Create(TagHelper_InvalidRestrictedChild, tagHelperDisplayName, restrictedChild, invalidCharacter);
542
public static
RazorDiagnostic
CreateTagHelper_InvalidBoundAttributeNullOrWhitespace(string tagHelperDisplayName, string propertyDisplayName)
543
=>
RazorDiagnostic
.Create(TagHelper_InvalidBoundAttributeNullOrWhitespace, tagHelperDisplayName, propertyDisplayName);
550
public static
RazorDiagnostic
CreateTagHelper_InvalidBoundAttributeName(string tagHelperDisplayName, string propertyDisplayName, string invalidName, char invalidCharacter)
551
=>
RazorDiagnostic
.Create(TagHelper_InvalidBoundAttributeName, tagHelperDisplayName, propertyDisplayName, invalidName, invalidCharacter);
558
public static
RazorDiagnostic
CreateTagHelper_InvalidBoundAttributeNameStartsWith(string tagHelperDisplayName, string propertyDisplayName, string invalidName)
559
=>
RazorDiagnostic
.Create(TagHelper_InvalidBoundAttributeNameStartsWith, tagHelperDisplayName, propertyDisplayName, invalidName, "data-");
566
public static
RazorDiagnostic
CreateTagHelper_InvalidBoundAttributePrefix(string tagHelperDisplayName, string propertyDisplayName, string invalidName, char invalidCharacter)
567
=>
RazorDiagnostic
.Create(TagHelper_InvalidBoundAttributePrefix, tagHelperDisplayName, propertyDisplayName, invalidName, invalidCharacter);
573
public static
RazorDiagnostic
CreateTagHelper_InvalidBoundAttributePrefixStartsWith(string tagHelperDisplayName, string propertyDisplayName, string invalidName)
574
=>
RazorDiagnostic
.Create(TagHelper_InvalidBoundAttributePrefixStartsWith, tagHelperDisplayName, propertyDisplayName, invalidName, "data-");
581
public static
RazorDiagnostic
CreateTagHelper_InvalidTargetedTagNameNullOrWhitespace()
582
=>
RazorDiagnostic
.Create(TagHelper_InvalidTargetedTagNameNullOrWhitespace);
589
public static
RazorDiagnostic
CreateTagHelper_InvalidTargetedTagName(string invalidTagName, char invalidCharacter)
590
=>
RazorDiagnostic
.Create(TagHelper_InvalidTargetedTagName, invalidTagName, invalidCharacter);
597
public static
RazorDiagnostic
CreateTagHelper_InvalidTargetedParentTagNameNullOrWhitespace()
598
=>
RazorDiagnostic
.Create(TagHelper_InvalidTargetedParentTagNameNullOrWhitespace);
605
public static
RazorDiagnostic
CreateTagHelper_InvalidTargetedParentTagName(string invalidTagName, char invalidCharacter)
606
=>
RazorDiagnostic
.Create(TagHelper_InvalidTargetedParentTagName, invalidTagName, invalidCharacter);
613
public static
RazorDiagnostic
CreateTagHelper_InvalidTargetedAttributeNameNullOrWhitespace()
614
=>
RazorDiagnostic
.Create(TagHelper_InvalidTargetedAttributeNameNullOrWhitespace);
621
public static
RazorDiagnostic
CreateTagHelper_InvalidTargetedAttributeName(string invalidAttributeName, char invalidCharacter)
622
=>
RazorDiagnostic
.Create(TagHelper_InvalidTargetedAttributeName, invalidAttributeName, invalidCharacter);
629
public static
RazorDiagnostic
CreateTagHelper_InvalidBoundAttributeParameterNullOrWhitespace(string attributeName)
630
=>
RazorDiagnostic
.Create(TagHelper_InvalidBoundAttributeParameterNullOrWhitespace, attributeName);
637
public static
RazorDiagnostic
CreateTagHelper_InvalidBoundAttributeParameterName(string attributeName, string invalidName, char invalidCharacter)
638
=>
RazorDiagnostic
.Create(TagHelper_InvalidBoundAttributeParameterName, attributeName, invalidName, invalidCharacter);
645
public static
RazorDiagnostic
CreateTagHelper_InvalidBoundDirectiveAttributeName(string tagHelperDisplayName, string propertyDisplayName, string invalidName)
646
=>
RazorDiagnostic
.Create(TagHelper_InvalidBoundDirectiveAttributeName, tagHelperDisplayName, propertyDisplayName, invalidName);
653
public static
RazorDiagnostic
CreateTagHelper_InvalidRequiredDirectiveAttributeName(string propertyDisplayName, string invalidName)
654
=>
RazorDiagnostic
.Create(TagHelper_InvalidRequiredDirectiveAttributeName, propertyDisplayName, invalidName);
661
public static
RazorDiagnostic
CreateTagHelper_InvalidBoundDirectiveAttributePrefix(string tagHelperDisplayName, string propertyDisplayName, string invalidName)
662
=>
RazorDiagnostic
.Create(TagHelper_InvalidBoundDirectiveAttributePrefix, tagHelperDisplayName, propertyDisplayName, invalidName);
675
public static
RazorDiagnostic
CreateRewriter_InsufficientStack(SourceSpan? location = null)
676
=>
RazorDiagnostic
.Create(Rewriter_InsufficientStack, location);
689
public static
RazorDiagnostic
CreateCssRewriting_ImportNotAllowed(SourceSpan location)
690
=>
RazorDiagnostic
.Create(CssRewriting_ImportNotAllowed, location);
Language\RazorSyntaxTree.cs (10)
18
private readonly ImmutableArray<
RazorDiagnostic
> _diagnostics;
19
private ImmutableArray<
RazorDiagnostic
> _allDiagnostics;
24
ImmutableArray<
RazorDiagnostic
> diagnostics,
37
public ImmutableArray<
RazorDiagnostic
> Diagnostics
48
static ImmutableArray<
RazorDiagnostic
> ComputeAllDiagnostics(ImmutableArray<
RazorDiagnostic
> treeDiagnostics, SyntaxNode root)
50
using var pooledList = ListPool<
RazorDiagnostic
>.GetPooledObject(out var rootDiagnostics);
51
using var diagnosticSet = new PooledHashSet<
RazorDiagnostic
>();
53
foreach (
var
diagnostic in treeDiagnostics)
62
foreach (
var
diagnostic in rootDiagnostics)
Language\RequiredAttributeDescriptor.cs (1)
33
ImmutableArray<
RazorDiagnostic
> diagnostics)
Language\RequiredAttributeDescriptorBuilder.cs (5)
40
private protected override RequiredAttributeDescriptor BuildCore(ImmutableArray<
RazorDiagnostic
> diagnostics)
58
private protected override void CollectDiagnostics(ref PooledHashSet<
RazorDiagnostic
> diagnostics)
64
var
diagnostic = RazorDiagnosticFactory.CreateTagHelper_InvalidTargetedAttributeNameNullOrWhitespace();
81
var
diagnostic = RazorDiagnosticFactory.CreateTagHelper_InvalidRequiredDirectiveAttributeName(
92
var
diagnostic = RazorDiagnosticFactory.CreateTagHelper_InvalidTargetedAttributeName(name, ch);
Language\Syntax\Generated\Syntax.xml.Internal.Generated.cs (90)
11
internal RazorBlockSyntax(SyntaxKind kind,
RazorDiagnostic
[] diagnostics)
29
internal RazorDocumentSyntax(SyntaxKind kind, RazorBlockSyntax document, SyntaxToken endOfFile,
RazorDiagnostic
[] diagnostics)
79
internal override GreenNode SetDiagnostics(
RazorDiagnostic
[] diagnostics)
91
internal RazorCommentBlockSyntax(SyntaxKind kind, SyntaxToken startCommentTransition, SyntaxToken startCommentStar, SyntaxToken comment, SyntaxToken endCommentStar, SyntaxToken endCommentTransition,
RazorDiagnostic
[] diagnostics)
159
internal override GreenNode SetDiagnostics(
RazorDiagnostic
[] diagnostics)
169
internal RazorMetaCodeSyntax(SyntaxKind kind, GreenNode metaCode, ISpanChunkGenerator chunkGenerator, SpanEditHandler editHandler,
RazorDiagnostic
[] diagnostics)
221
internal override GreenNode SetDiagnostics(
RazorDiagnostic
[] diagnostics)
229
internal GenericBlockSyntax(SyntaxKind kind, GreenNode children,
RazorDiagnostic
[] diagnostics)
275
internal override GreenNode SetDiagnostics(
RazorDiagnostic
[] diagnostics)
285
internal UnclassifiedTextLiteralSyntax(SyntaxKind kind, GreenNode literalTokens, ISpanChunkGenerator chunkGenerator, SpanEditHandler editHandler,
RazorDiagnostic
[] diagnostics)
337
internal override GreenNode SetDiagnostics(
RazorDiagnostic
[] diagnostics)
343
internal MarkupSyntaxNode(SyntaxKind kind,
RazorDiagnostic
[] diagnostics)
358
internal MarkupBlockSyntax(SyntaxKind kind, GreenNode children,
RazorDiagnostic
[] diagnostics)
404
internal override GreenNode SetDiagnostics(
RazorDiagnostic
[] diagnostics)
414
internal MarkupTransitionSyntax(SyntaxKind kind, GreenNode transitionTokens, ISpanChunkGenerator chunkGenerator, SpanEditHandler editHandler,
RazorDiagnostic
[] diagnostics)
466
internal override GreenNode SetDiagnostics(
RazorDiagnostic
[] diagnostics)
476
internal MarkupTextLiteralSyntax(SyntaxKind kind, GreenNode literalTokens, ISpanChunkGenerator chunkGenerator, SpanEditHandler editHandler,
RazorDiagnostic
[] diagnostics)
528
internal override GreenNode SetDiagnostics(
RazorDiagnostic
[] diagnostics)
538
internal MarkupEphemeralTextLiteralSyntax(SyntaxKind kind, GreenNode literalTokens, ISpanChunkGenerator chunkGenerator, SpanEditHandler editHandler,
RazorDiagnostic
[] diagnostics)
590
internal override GreenNode SetDiagnostics(
RazorDiagnostic
[] diagnostics)
598
internal MarkupCommentBlockSyntax(SyntaxKind kind, GreenNode children,
RazorDiagnostic
[] diagnostics)
644
internal override GreenNode SetDiagnostics(
RazorDiagnostic
[] diagnostics)
653
internal MarkupMinimizedAttributeBlockSyntax(SyntaxKind kind, MarkupTextLiteralSyntax namePrefix, MarkupTextLiteralSyntax name,
RazorDiagnostic
[] diagnostics)
709
internal override GreenNode SetDiagnostics(
RazorDiagnostic
[] diagnostics)
723
internal MarkupAttributeBlockSyntax(SyntaxKind kind, MarkupTextLiteralSyntax namePrefix, MarkupTextLiteralSyntax name, MarkupTextLiteralSyntax nameSuffix, SyntaxToken equalsToken, MarkupTextLiteralSyntax valuePrefix, RazorBlockSyntax value, MarkupTextLiteralSyntax valueSuffix,
RazorDiagnostic
[] diagnostics)
833
internal override GreenNode SetDiagnostics(
RazorDiagnostic
[] diagnostics)
841
internal MarkupMiscAttributeContentSyntax(SyntaxKind kind, GreenNode children,
RazorDiagnostic
[] diagnostics)
887
internal override GreenNode SetDiagnostics(
RazorDiagnostic
[] diagnostics)
896
internal MarkupLiteralAttributeValueSyntax(SyntaxKind kind, MarkupTextLiteralSyntax prefix, MarkupTextLiteralSyntax value,
RazorDiagnostic
[] diagnostics)
958
internal override GreenNode SetDiagnostics(
RazorDiagnostic
[] diagnostics)
967
internal MarkupDynamicAttributeValueSyntax(SyntaxKind kind, MarkupTextLiteralSyntax prefix, RazorBlockSyntax value,
RazorDiagnostic
[] diagnostics)
1023
internal override GreenNode SetDiagnostics(
RazorDiagnostic
[] diagnostics)
1029
internal BaseMarkupStartTagSyntax(SyntaxKind kind,
RazorDiagnostic
[] diagnostics)
1058
internal BaseMarkupEndTagSyntax(SyntaxKind kind,
RazorDiagnostic
[] diagnostics)
1087
internal BaseMarkupElementSyntax(SyntaxKind kind,
RazorDiagnostic
[] diagnostics)
1108
internal MarkupElementSyntax(SyntaxKind kind, MarkupStartTagSyntax markupStartTag, GreenNode body, MarkupEndTagSyntax markupEndTag,
RazorDiagnostic
[] diagnostics)
1182
internal override GreenNode SetDiagnostics(
RazorDiagnostic
[] diagnostics)
1198
internal MarkupStartTagSyntax(SyntaxKind kind, SyntaxToken openAngle, SyntaxToken bang, SyntaxToken name, GreenNode attributes, SyntaxToken forwardSlash, SyntaxToken closeAngle, bool isMarkupTransition, ISpanChunkGenerator chunkGenerator, SpanEditHandler editHandler,
RazorDiagnostic
[] diagnostics)
1299
internal override GreenNode SetDiagnostics(
RazorDiagnostic
[] diagnostics)
1315
internal MarkupEndTagSyntax(SyntaxKind kind, SyntaxToken openAngle, SyntaxToken forwardSlash, SyntaxToken bang, SyntaxToken name, MarkupMiscAttributeContentSyntax miscAttributeContent, SyntaxToken closeAngle, bool isMarkupTransition, ISpanChunkGenerator chunkGenerator, SpanEditHandler editHandler,
RazorDiagnostic
[] diagnostics)
1410
internal override GreenNode SetDiagnostics(
RazorDiagnostic
[] diagnostics)
1421
internal MarkupTagHelperElementSyntax(SyntaxKind kind, MarkupTagHelperStartTagSyntax tagHelperStartTag, GreenNode body, MarkupTagHelperEndTagSyntax tagHelperEndTag, TagHelperInfo tagHelperInfo,
RazorDiagnostic
[] diagnostics)
1498
internal override GreenNode SetDiagnostics(
RazorDiagnostic
[] diagnostics)
1513
internal MarkupTagHelperStartTagSyntax(SyntaxKind kind, SyntaxToken openAngle, SyntaxToken bang, SyntaxToken name, GreenNode attributes, SyntaxToken forwardSlash, SyntaxToken closeAngle, ISpanChunkGenerator chunkGenerator, SpanEditHandler editHandler,
RazorDiagnostic
[] diagnostics)
1611
internal override GreenNode SetDiagnostics(
RazorDiagnostic
[] diagnostics)
1626
internal MarkupTagHelperEndTagSyntax(SyntaxKind kind, SyntaxToken openAngle, SyntaxToken forwardSlash, SyntaxToken bang, SyntaxToken name, MarkupMiscAttributeContentSyntax miscAttributeContent, SyntaxToken closeAngle, ISpanChunkGenerator chunkGenerator, SpanEditHandler editHandler,
RazorDiagnostic
[] diagnostics)
1718
internal override GreenNode SetDiagnostics(
RazorDiagnostic
[] diagnostics)
1733
internal MarkupTagHelperAttributeSyntax(SyntaxKind kind, MarkupTextLiteralSyntax namePrefix, MarkupTextLiteralSyntax name, MarkupTextLiteralSyntax nameSuffix, SyntaxToken equalsToken, MarkupTextLiteralSyntax valuePrefix, MarkupTagHelperAttributeValueSyntax value, MarkupTextLiteralSyntax valueSuffix, TagHelperAttributeInfo tagHelperAttributeInfo,
RazorDiagnostic
[] diagnostics)
1840
internal override GreenNode SetDiagnostics(
RazorDiagnostic
[] diagnostics)
1850
internal MarkupMinimizedTagHelperAttributeSyntax(SyntaxKind kind, MarkupTextLiteralSyntax namePrefix, MarkupTextLiteralSyntax name, TagHelperAttributeInfo tagHelperAttributeInfo,
RazorDiagnostic
[] diagnostics)
1909
internal override GreenNode SetDiagnostics(
RazorDiagnostic
[] diagnostics)
1917
internal MarkupTagHelperAttributeValueSyntax(SyntaxKind kind, GreenNode children,
RazorDiagnostic
[] diagnostics)
1963
internal override GreenNode SetDiagnostics(
RazorDiagnostic
[] diagnostics)
1981
internal MarkupTagHelperDirectiveAttributeSyntax(SyntaxKind kind, MarkupTextLiteralSyntax namePrefix, RazorMetaCodeSyntax transition, MarkupTextLiteralSyntax name, RazorMetaCodeSyntax colon, MarkupTextLiteralSyntax parameterName, MarkupTextLiteralSyntax nameSuffix, SyntaxToken equalsToken, MarkupTextLiteralSyntax valuePrefix, MarkupTagHelperAttributeValueSyntax value, MarkupTextLiteralSyntax valueSuffix, TagHelperAttributeInfo tagHelperAttributeInfo,
RazorDiagnostic
[] diagnostics)
2118
internal override GreenNode SetDiagnostics(
RazorDiagnostic
[] diagnostics)
2131
internal MarkupMinimizedTagHelperDirectiveAttributeSyntax(SyntaxKind kind, MarkupTextLiteralSyntax namePrefix, RazorMetaCodeSyntax transition, MarkupTextLiteralSyntax name, RazorMetaCodeSyntax colon, MarkupTextLiteralSyntax parameterName, TagHelperAttributeInfo tagHelperAttributeInfo,
RazorDiagnostic
[] diagnostics)
2220
internal override GreenNode SetDiagnostics(
RazorDiagnostic
[] diagnostics)
2226
internal CSharpSyntaxNode(SyntaxKind kind,
RazorDiagnostic
[] diagnostics)
2241
internal CSharpCodeBlockSyntax(SyntaxKind kind, GreenNode children,
RazorDiagnostic
[] diagnostics)
2287
internal override GreenNode SetDiagnostics(
RazorDiagnostic
[] diagnostics)
2297
internal CSharpTransitionSyntax(SyntaxKind kind, SyntaxToken transition, ISpanChunkGenerator chunkGenerator, SpanEditHandler editHandler,
RazorDiagnostic
[] diagnostics)
2343
internal override GreenNode SetDiagnostics(
RazorDiagnostic
[] diagnostics)
2353
internal CSharpStatementLiteralSyntax(SyntaxKind kind, GreenNode literalTokens, ISpanChunkGenerator chunkGenerator, SpanEditHandler editHandler,
RazorDiagnostic
[] diagnostics)
2405
internal override GreenNode SetDiagnostics(
RazorDiagnostic
[] diagnostics)
2415
internal CSharpExpressionLiteralSyntax(SyntaxKind kind, GreenNode literalTokens, ISpanChunkGenerator chunkGenerator, SpanEditHandler editHandler,
RazorDiagnostic
[] diagnostics)
2467
internal override GreenNode SetDiagnostics(
RazorDiagnostic
[] diagnostics)
2477
internal CSharpEphemeralTextLiteralSyntax(SyntaxKind kind, GreenNode literalTokens, ISpanChunkGenerator chunkGenerator, SpanEditHandler editHandler,
RazorDiagnostic
[] diagnostics)
2529
internal override GreenNode SetDiagnostics(
RazorDiagnostic
[] diagnostics)
2537
internal CSharpTemplateBlockSyntax(SyntaxKind kind, GreenNode children,
RazorDiagnostic
[] diagnostics)
2583
internal override GreenNode SetDiagnostics(
RazorDiagnostic
[] diagnostics)
2589
internal CSharpRazorBlockSyntax(SyntaxKind kind,
RazorDiagnostic
[] diagnostics)
2609
internal CSharpStatementSyntax(SyntaxKind kind, CSharpTransitionSyntax transition, CSharpSyntaxNode body,
RazorDiagnostic
[] diagnostics)
2659
internal override GreenNode SetDiagnostics(
RazorDiagnostic
[] diagnostics)
2669
internal CSharpStatementBodySyntax(SyntaxKind kind, RazorMetaCodeSyntax openBrace, CSharpCodeBlockSyntax csharpCode, RazorMetaCodeSyntax closeBrace,
RazorDiagnostic
[] diagnostics)
2725
internal override GreenNode SetDiagnostics(
RazorDiagnostic
[] diagnostics)
2734
internal CSharpExplicitExpressionSyntax(SyntaxKind kind, CSharpTransitionSyntax transition, CSharpSyntaxNode body,
RazorDiagnostic
[] diagnostics)
2784
internal override GreenNode SetDiagnostics(
RazorDiagnostic
[] diagnostics)
2794
internal CSharpExplicitExpressionBodySyntax(SyntaxKind kind, RazorMetaCodeSyntax openParen, CSharpCodeBlockSyntax csharpCode, RazorMetaCodeSyntax closeParen,
RazorDiagnostic
[] diagnostics)
2850
internal override GreenNode SetDiagnostics(
RazorDiagnostic
[] diagnostics)
2859
internal CSharpImplicitExpressionSyntax(SyntaxKind kind, CSharpTransitionSyntax transition, CSharpSyntaxNode body,
RazorDiagnostic
[] diagnostics)
2909
internal override GreenNode SetDiagnostics(
RazorDiagnostic
[] diagnostics)
2917
internal CSharpImplicitExpressionBodySyntax(SyntaxKind kind, CSharpCodeBlockSyntax csharpCode,
RazorDiagnostic
[] diagnostics)
2957
internal override GreenNode SetDiagnostics(
RazorDiagnostic
[] diagnostics)
2963
internal BaseRazorDirectiveSyntax(SyntaxKind kind,
RazorDiagnostic
[] diagnostics)
2980
internal RazorDirectiveSyntax(SyntaxKind kind, CSharpTransitionSyntax transition, CSharpSyntaxNode body, DirectiveDescriptor directiveDescriptor,
RazorDiagnostic
[] diagnostics)
3033
internal override GreenNode SetDiagnostics(
RazorDiagnostic
[] diagnostics)
3043
internal RazorUsingDirectiveSyntax(SyntaxKind kind, CSharpTransitionSyntax transition, CSharpSyntaxNode body, DirectiveDescriptor directiveDescriptor,
RazorDiagnostic
[] diagnostics)
3096
internal override GreenNode SetDiagnostics(
RazorDiagnostic
[] diagnostics)
3105
internal RazorDirectiveBodySyntax(SyntaxKind kind, RazorSyntaxNode keyword, CSharpCodeBlockSyntax csharpCode,
RazorDiagnostic
[] diagnostics)
3161
internal override GreenNode SetDiagnostics(
RazorDiagnostic
[] diagnostics)
Language\Syntax\GreenNode.cs (6)
14
private static readonly ConditionalWeakTable<GreenNode,
RazorDiagnostic
[]> s_diagnosticsTable = new();
15
private static readonly
RazorDiagnostic
[] s_emptyDiagnostics = [];
31
protected GreenNode(SyntaxKind kind,
RazorDiagnostic
[]? diagnostics)
36
protected GreenNode(SyntaxKind kind, int width,
RazorDiagnostic
[]? diagnostics)
161
internal abstract GreenNode SetDiagnostics(
RazorDiagnostic
[]? diagnostics);
163
internal
RazorDiagnostic
[] GetDiagnostics()
Language\Syntax\GreenNodeExtensions.cs (2)
25
public static TNode WithDiagnosticsGreen<TNode>(this TNode node,
RazorDiagnostic
[] diagnostics)
31
public static TNode WithDiagnosticsGreen<TNode>(this TNode node, params ImmutableArray<
RazorDiagnostic
> diagnostics)
Language\Syntax\InternalSyntax\RazorSyntaxNode.cs (2)
19
protected RazorSyntaxNode(SyntaxKind kind,
RazorDiagnostic
[] diagnostics)
24
protected RazorSyntaxNode(SyntaxKind kind, int width,
RazorDiagnostic
[] diagnostics)
Language\Syntax\InternalSyntax\SyntaxFactory.cs (2)
10
internal static SyntaxToken Token(SyntaxKind kind, string content, params
RazorDiagnostic
[] diagnostics)
20
internal static SyntaxToken MissingToken(SyntaxKind kind, params
RazorDiagnostic
[] diagnostics)
Language\Syntax\InternalSyntax\SyntaxList.cs (10)
18
internal SyntaxList(
RazorDiagnostic
[] diagnostics)
187
internal WithTwoChildren(GreenNode child0, GreenNode child1,
RazorDiagnostic
[] diagnostics)
221
internal override GreenNode SetDiagnostics(
RazorDiagnostic
[] errors)
244
internal WithThreeChildren(GreenNode child0, GreenNode child1, GreenNode child2,
RazorDiagnostic
[] diagnostics)
283
internal override GreenNode SetDiagnostics(
RazorDiagnostic
[] errors)
299
internal WithManyChildrenBase(ArrayElement<GreenNode>[] children,
RazorDiagnostic
[] diagnostics)
352
internal WithManyChildren(ArrayElement<GreenNode>[] children,
RazorDiagnostic
[] diagnostics)
357
internal override GreenNode SetDiagnostics(
RazorDiagnostic
[] errors)
373
internal WithLotsOfChildren(ArrayElement<GreenNode>[] children, int[] childOffsets,
RazorDiagnostic
[] diagnostics)
412
internal override GreenNode SetDiagnostics(
RazorDiagnostic
[] errors)
Language\Syntax\InternalSyntax\SyntaxToken.cs (4)
13
RazorDiagnostic
[]? diagnostics)
28
internal override GreenNode SetDiagnostics(
RazorDiagnostic
[]? diagnostics)
70
internal static SyntaxToken CreateMissing(SyntaxKind kind, params
RazorDiagnostic
[] diagnostics)
77
internal MissingToken(SyntaxKind kind,
RazorDiagnostic
[] diagnostics)
Language\Syntax\InternalSyntax\SyntaxTokenCache.cs (1)
18
public bool CanBeCached(SyntaxKind kind, params
RazorDiagnostic
[] diagnostics)
Language\Syntax\SyntaxFactory.cs (7)
12
public static SyntaxToken Token(SyntaxKind kind, params
RazorDiagnostic
[] diagnostics)
15
public static SyntaxToken Token(SyntaxKind kind, string content, params
RazorDiagnostic
[] diagnostics)
19
SyntaxKind kind, SyntaxNode? parent, int position, params
RazorDiagnostic
[] diagnostics)
23
SyntaxKind kind, string content, SyntaxNode? parent, int position, params
RazorDiagnostic
[] diagnostics)
27
SyntaxKind kind, SyntaxNode? parent, int position, int index, params
RazorDiagnostic
[] diagnostics)
31
SyntaxKind kind, string content, SyntaxNode? parent, int position, int index, params
RazorDiagnostic
[] diagnostics)
34
internal static SyntaxToken MissingToken(SyntaxKind kind, params
RazorDiagnostic
[] diagnostics)
Language\Syntax\SyntaxNode.cs (1)
390
public
RazorDiagnostic
[] GetDiagnostics()
Language\Syntax\SyntaxNodeExtensions.cs (7)
15
public static TNode WithDiagnostics<TNode>(this TNode node, params
RazorDiagnostic
[] diagnostics) where TNode : SyntaxNode
20
public static TNode AppendDiagnostic<TNode>(this TNode node, params ReadOnlySpan<
RazorDiagnostic
> diagnostics) where TNode : SyntaxNode
22
RazorDiagnostic
[] allDiagnostics = [
35
/// <returns>The list of <see cref="
RazorDiagnostic
">RazorDiagnostics</see>.</returns>
36
public static void CollectAllDiagnostics<TNode>(this TNode node, List<
RazorDiagnostic
> list)
264
private sealed class DiagnosticSyntaxWalker(List<
RazorDiagnostic
> diagnostics) : SyntaxWalker
266
private readonly List<
RazorDiagnostic
> _diagnostics = diagnostics ?? [];
Language\Syntax\SyntaxNodeOrToken.cs (2)
258
public IEnumerable<
RazorDiagnostic
> GetDiagnostics()
270
return SpecializedCollections.EmptyEnumerable<
RazorDiagnostic
>();
Language\Syntax\SyntaxSerializer.cs (1)
163
private static string GetDiagnosticsText(
RazorDiagnostic
[] diagnostics)
Language\Syntax\SyntaxToken.cs (3)
183
public IEnumerable<
RazorDiagnostic
> GetDiagnostics()
187
return SpecializedCollections.EmptyEnumerable<
RazorDiagnostic
>();
193
? SpecializedCollections.EmptyEnumerable<
RazorDiagnostic
>()
Language\TagHelperDescriptor.cs (5)
69
ImmutableArray<
RazorDiagnostic
> diagnostics)
166
public IEnumerable<
RazorDiagnostic
> GetAllDiagnostics()
168
using var diagnostics = new PooledArrayBuilder<
RazorDiagnostic
>();
172
foreach (
var
diagnostic in diagnostics)
178
internal void AppendAllDiagnostics(ref PooledArrayBuilder<
RazorDiagnostic
> diagnostics)
Language\TagHelperDescriptorBuilder.cs (1)
156
private protected override TagHelperDescriptor BuildCore(ImmutableArray<
RazorDiagnostic
> diagnostics)
Language\TagHelperObject`1.cs (3)
16
public ImmutableArray<
RazorDiagnostic
> Diagnostics { get; }
21
private protected TagHelperObject(ImmutableArray<
RazorDiagnostic
> diagnostics)
36
foreach (
var
diagnostic in Diagnostics)
Language\TagHelperObjectBuilder`1.cs (6)
13
private ImmutableArray<
RazorDiagnostic
>.Builder? _diagnostics;
16
public ImmutableArray<
RazorDiagnostic
>.Builder Diagnostics
17
=> _diagnostics ??= ImmutableArray.CreateBuilder<
RazorDiagnostic
>();
32
var diagnostics = new PooledHashSet<
RazorDiagnostic
>();
46
private protected abstract T BuildCore(ImmutableArray<
RazorDiagnostic
> diagnostics);
48
private protected virtual void CollectDiagnostics(ref PooledHashSet<
RazorDiagnostic
> diagnostics)
Language\TagMatchingRuleDescriptor.cs (4)
30
ImmutableArray<
RazorDiagnostic
> diagnostics)
70
public IEnumerable<
RazorDiagnostic
> GetAllDiagnostics()
74
foreach (
var
diagnostic in attribute.Diagnostics)
80
foreach (
var
diagnostic in Diagnostics)
Language\TagMatchingRuleDescriptorBuilder.cs (6)
46
private protected override TagMatchingRuleDescriptor BuildCore(ImmutableArray<
RazorDiagnostic
> diagnostics)
57
private protected override void CollectDiagnostics(ref PooledHashSet<
RazorDiagnostic
> diagnostics)
61
var
diagnostic = RazorDiagnosticFactory.CreateTagHelper_InvalidTargetedTagNameNullOrWhitespace();
71
var
diagnostic = RazorDiagnosticFactory.CreateTagHelper_InvalidTargetedTagName(TagName, character);
82
var
diagnostic = RazorDiagnosticFactory.CreateTagHelper_InvalidTargetedParentTagNameNullOrWhitespace();
92
var
diagnostic = RazorDiagnosticFactory.CreateTagHelper_InvalidTargetedParentTagName(ParentTag, character);
Mvc.Version1_X\ViewComponentTagHelperDescriptorFactory.cs (2)
69
if (TryFindInvokeMethod(type, out var method, out
var
diagnostic))
89
private bool TryFindInvokeMethod(INamedTypeSymbol type, out IMethodSymbol method, out
RazorDiagnostic
diagnostic)
Mvc.Version2_X\ViewComponentTagHelperDescriptorFactory.cs (2)
69
if (TryFindInvokeMethod(type, out var method, out
var
diagnostic))
89
private bool TryFindInvokeMethod(INamedTypeSymbol type, out IMethodSymbol method, out
RazorDiagnostic
diagnostic)
Mvc\RazorExtensionsDiagnosticFactory.cs (14)
19
public static
RazorDiagnostic
CreateViewComponent_CannotFindMethod(string tagHelperType)
20
=>
RazorDiagnostic
.Create(
32
public static
RazorDiagnostic
CreateViewComponent_AmbiguousMethods(string tagHelperType)
33
=>
RazorDiagnostic
.Create(
45
public static
RazorDiagnostic
CreateViewComponent_AsyncMethod_ShouldReturnTask(string tagHelperType)
46
=>
RazorDiagnostic
.Create(
58
public static
RazorDiagnostic
CreateViewComponent_SyncMethod_ShouldReturnValue(string tagHelperType)
59
=>
RazorDiagnostic
.Create(
70
public static
RazorDiagnostic
CreateViewComponent_SyncMethod_CannotReturnTask(string tagHelperType)
71
=>
RazorDiagnostic
.Create(
83
public static
RazorDiagnostic
CreatePageDirective_CannotBeImported(SourceSpan source)
87
return
RazorDiagnostic
.Create(PageDirective_CannotBeImported, source, PageDirective.Directive.Directive, fileName);
95
public static
RazorDiagnostic
CreatePageDirective_MustExistAtTheTopOfFile(SourceSpan source)
96
=>
RazorDiagnostic
.Create(PageDirective_MustExistAtTheTopOfFile, source, PageDirective.Directive.Directive);
Mvc\ViewComponentTagHelperDescriptorFactory.cs (2)
69
if (TryFindInvokeMethod(type, out var method, out
var
diagnostic))
89
private bool TryFindInvokeMethod(INamedTypeSymbol type, out IMethodSymbol method, out
RazorDiagnostic
diagnostic)
SourceGenerators\Diagnostics\RazorDiagnostics.cs (1)
92
public static Diagnostic AsDiagnostic(this
RazorDiagnostic
razorDiagnostic)
SourceGenerators\RazorSourceGenerator.cs (1)
332
foreach (
var
razorDiagnostic in csharpDocument.Diagnostics)
Microsoft.CodeAnalysis.Razor.UnitTests (6)
DefaultTagHelperDescriptorFactoryTest.cs (6)
863
var
diagnostic = Assert.Single(attribute.Diagnostics);
1162
public static TheoryData<string, ImmutableArray<BoundAttributeDescriptor>, ImmutableArray<
RazorDiagnostic
>> TagHelperWithPrefixData
1257
static (string, ImmutableArray<BoundAttributeDescriptor>, ImmutableArray<
RazorDiagnostic
>) Combine(
1258
(string name, ImmutableArray<BoundAttributeDescriptor> boundAttributes) pair, params ImmutableArray<
RazorDiagnostic
> diagnostics)
1283
ImmutableArray<
RazorDiagnostic
> expectedDiagnostics)
1296
Assert.Equal<
RazorDiagnostic
>(expectedDiagnostics, [.. descriptor.GetAllDiagnostics()]);
Microsoft.CodeAnalysis.Razor.Workspaces (13)
CodeActions\Razor\ComponentAccessibilityCodeActionProvider.cs (1)
318
foreach (
var
diagnostic in context.CodeDocument.GetRequiredCSharpDocument().Diagnostics)
Diagnostics\RazorDiagnosticHelper.cs (3)
48
internal static LspDiagnostic[] Convert(ImmutableArray<
RazorDiagnostic
> diagnostics, SourceText sourceText, IDocumentSnapshot documentSnapshot)
53
foreach (
var
diagnostic in diagnostics)
87
internal static VSDiagnostic ConvertToVSDiagnostic(
RazorDiagnostic
razorDiagnostic, SourceText sourceText, IDocumentSnapshot? documentSnapshot)
Formatting\Passes\FormattingDiagnosticValidationPass.cs (9)
55
private static string GetLogMessage(ImmutableArray<
RazorDiagnostic
> originalDiagnostics, ImmutableArray<
RazorDiagnostic
> changedDiagnostics)
61
foreach (
var
diagnostic in originalDiagnostics)
67
foreach (
var
diagnostic in changedDiagnostics)
75
private class LocationIgnoringDiagnosticComparer : IEqualityComparer<
RazorDiagnostic
>
77
public static IEqualityComparer<
RazorDiagnostic
> Instance = new LocationIgnoringDiagnosticComparer();
79
public bool Equals(
RazorDiagnostic
? x,
RazorDiagnostic
? y)
85
public int GetHashCode(
RazorDiagnostic
obj)
Microsoft.NET.Sdk.Razor.SourceGenerators.UnitTests (4)
RazorDiagnosticTest.cs (4)
16
var
diagnostics =
RazorDiagnostic
.Create(new RazorDiagnosticDescriptor("RZC1001", "Some message", RazorDiagnosticSeverity.Error));
33
var
diagnostics =
RazorDiagnostic
.Create(new RazorDiagnosticDescriptor("RZC1001", "Some message", RazorDiagnosticSeverity.Error), span);
Microsoft.VisualStudio.LanguageServices.Razor.UnitTests (1)
src\Razor\src\Razor\test\Microsoft.CodeAnalysis.Razor.CohostingShared.UnitTests\Diagnostics\RazorDiagnosticHelperTest.cs (1)
20
var
razorDiagnostic = RazorDiagnosticFactory.CreateDirective_BlockDirectiveCannotBeImported("test");
Microsoft.VisualStudioCode.RazorExtension.UnitTests (1)
src\Razor\src\Razor\test\Microsoft.CodeAnalysis.Razor.CohostingShared.UnitTests\Diagnostics\RazorDiagnosticHelperTest.cs (1)
20
var
razorDiagnostic = RazorDiagnosticFactory.CreateDirective_BlockDirectiveCannotBeImported("test");