Skip to content

Commit 1ba5890

Browse files
Remove IntermediateNode.Annotations property
1 parent caa8915 commit 1ba5890

File tree

3 files changed

+0
-55
lines changed

3 files changed

+0
-55
lines changed

src/Compiler/Microsoft.CodeAnalysis.Razor.Compiler/src/Language/Intermediate/ComponentAttributeIntermediateNode.cs

Lines changed: 0 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -60,11 +60,6 @@ public ComponentAttributeIntermediateNode(TagHelperHtmlAttributeIntermediateNode
6060
AttributeStructure = attributeNode.AttributeStructure;
6161
Source = attributeNode.Source;
6262

63-
foreach (var annotation in attributeNode.Annotations)
64-
{
65-
Annotations[annotation.Key] = annotation.Value;
66-
}
67-
6863
for (var i = 0; i < attributeNode.Children.Count; i++)
6964
{
7065
Children.Add(attributeNode.Children[i]);
@@ -91,11 +86,6 @@ public ComponentAttributeIntermediateNode(TagHelperPropertyIntermediateNode prop
9186
TagHelper = propertyNode.TagHelper;
9287
TypeName = propertyNode.BoundAttribute.IsWeaklyTyped() ? null : propertyNode.BoundAttribute.TypeName;
9388

94-
foreach (var annotation in propertyNode.Annotations)
95-
{
96-
Annotations[annotation.Key] = annotation.Value;
97-
}
98-
9989
for (var i = 0; i < propertyNode.Children.Count; i++)
10090
{
10191
Children.Add(propertyNode.Children[i]);
@@ -120,11 +110,6 @@ public ComponentAttributeIntermediateNode(TagHelperDirectiveAttributeIntermediat
120110
TagHelper = directiveAttributeNode.TagHelper;
121111
TypeName = directiveAttributeNode.BoundAttribute.IsWeaklyTyped() ? null : directiveAttributeNode.BoundAttribute.TypeName;
122112

123-
foreach (var annotation in directiveAttributeNode.Annotations)
124-
{
125-
Annotations[annotation.Key] = annotation.Value;
126-
}
127-
128113
for (var i = 0; i < directiveAttributeNode.Children.Count; i++)
129114
{
130115
Children.Add(directiveAttributeNode.Children[i]);
@@ -149,11 +134,6 @@ public ComponentAttributeIntermediateNode(TagHelperDirectiveAttributeParameterIn
149134
TagHelper = directiveAttributeParameterNode.TagHelper;
150135
TypeName = directiveAttributeParameterNode.BoundAttributeParameter.TypeName;
151136

152-
foreach (var annotation in directiveAttributeParameterNode.Annotations)
153-
{
154-
Annotations[annotation.Key] = annotation.Value;
155-
}
156-
157137
for (var i = 0; i < directiveAttributeParameterNode.Children.Count; i++)
158138
{
159139
Children.Add(directiveAttributeParameterNode.Children[i]);

src/Compiler/Microsoft.CodeAnalysis.Razor.Compiler/src/Language/Intermediate/IntermediateNode.cs

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -11,13 +11,9 @@ namespace Microsoft.AspNetCore.Razor.Language.Intermediate;
1111
[DebuggerDisplay($"{{{nameof(GetDebuggerDisplay)}(),nq}}")]
1212
public abstract class IntermediateNode
1313
{
14-
private ItemCollection? _annotations;
15-
1614
private ImmutableArray<RazorDiagnostic>.Builder? _diagnosticsBuilder;
1715
private ImmutableArray<RazorDiagnostic>? _diagnostics;
1816

19-
public ItemCollection Annotations => _annotations ??= [];
20-
2117
public ImmutableArray<RazorDiagnostic> Diagnostics
2218
=> _diagnostics ??= _diagnosticsBuilder?.ToImmutable() ?? [];
2319

src/Shared/Microsoft.AspNetCore.Razor.Test.Common/Language/Intermediate/IntermediateNodeAssert.cs

Lines changed: 0 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -64,37 +64,6 @@ public static void Children(IntermediateNode node, params Action<IntermediateNod
6464
}
6565
}
6666

67-
public static void AnnotationEquals(IntermediateNode node, object value)
68-
{
69-
AnnotationEquals(node, value, value);
70-
}
71-
72-
public static void AnnotationEquals(IntermediateNode node, object key, object value)
73-
{
74-
try
75-
{
76-
Assert.NotNull(node);
77-
Assert.Equal(value, node.Annotations[key]);
78-
}
79-
catch (XunitException e)
80-
{
81-
throw new IntermediateNodeAssertException(node, node.Children, e.Message, e);
82-
}
83-
}
84-
85-
public static void HasAnnotation(IntermediateNode node, object key)
86-
{
87-
try
88-
{
89-
Assert.NotNull(node);
90-
Assert.NotNull(node.Annotations[key]);
91-
}
92-
catch (XunitException e)
93-
{
94-
throw new IntermediateNodeAssertException(node, node.Children, e.Message, e);
95-
}
96-
}
97-
9867
public static void Html(string expected, IntermediateNode node)
9968
{
10069
try

0 commit comments

Comments
 (0)