From 8ffa56ada13e72ecd6968fd01ff6135ba3a25f98 Mon Sep 17 00:00:00 2001 From: Chris Sienkiewicz Date: Thu, 14 Nov 2024 13:34:43 -0800 Subject: [PATCH 1/3] Emit a dummy line of code for design time bind properties --- .../CSharp/BindTagHelperDescriptorProvider.cs | 1 + .../Components/ComponentBindLoweringPass.cs | 54 +++++++++---------- .../Components/ComponentRuntimeNodeWriter.cs | 12 +++++ 3 files changed, 40 insertions(+), 27 deletions(-) diff --git a/src/Compiler/Microsoft.CodeAnalysis.Razor.Compiler/src/CSharp/BindTagHelperDescriptorProvider.cs b/src/Compiler/Microsoft.CodeAnalysis.Razor.Compiler/src/CSharp/BindTagHelperDescriptorProvider.cs index e2c3d9f77c5..8177a52d5fb 100644 --- a/src/Compiler/Microsoft.CodeAnalysis.Razor.Compiler/src/CSharp/BindTagHelperDescriptorProvider.cs +++ b/src/Compiler/Microsoft.CodeAnalysis.Razor.Compiler/src/CSharp/BindTagHelperDescriptorProvider.cs @@ -667,6 +667,7 @@ private static void AddComponentBindTagHelpers(TagHelperDescriptor tagHelper, re attribute.Name = "@bind-" + valueAttribute.Name; attribute.TypeName = changeAttribute.TypeName; attribute.IsEnum = valueAttribute.IsEnum; + attribute.ContainingType = valueAttribute.ContainingType; attribute.SetMetadata( PropertyName(valueAttribute.GetPropertyName()), diff --git a/src/Compiler/Microsoft.CodeAnalysis.Razor.Compiler/src/Language/Components/ComponentBindLoweringPass.cs b/src/Compiler/Microsoft.CodeAnalysis.Razor.Compiler/src/Language/Components/ComponentBindLoweringPass.cs index 5c67866a287..ba9ef888d6d 100644 --- a/src/Compiler/Microsoft.CodeAnalysis.Razor.Compiler/src/Language/Components/ComponentBindLoweringPass.cs +++ b/src/Compiler/Microsoft.CodeAnalysis.Razor.Compiler/src/Language/Components/ComponentBindLoweringPass.cs @@ -537,7 +537,7 @@ private IntermediateNode[] RewriteUsage(IntermediateNode parent, BindEntry bindE ComponentAttributeIntermediateNode valueNode = node != null ? new ComponentAttributeIntermediateNode(node) : new ComponentAttributeIntermediateNode(getNode); valueNode.Annotations[ComponentMetadata.Common.OriginalAttributeName] = bindEntry.GetOriginalAttributeName(); - valueNode.Annotations[ComponentMetadata.Bind.PropertySpan] = bindEntry.GetOriginalPropertySpan(); + valueNode.Annotations[ComponentMetadata.Bind.PropertySpan] = GetOriginalPropertySpan(valueNode); valueNode.AttributeName = valueAttributeName; valueNode.BoundAttribute = valueAttribute; // Might be null if it doesn't match a component attribute valueNode.PropertyName = valuePropertyName; @@ -555,7 +555,7 @@ private IntermediateNode[] RewriteUsage(IntermediateNode parent, BindEntry bindE var changeNode = node != null ? new ComponentAttributeIntermediateNode(node) : new ComponentAttributeIntermediateNode(getNode); changeNode.Annotations[ComponentMetadata.Common.OriginalAttributeName] = bindEntry.GetOriginalAttributeName(); - changeNode.Annotations[ComponentMetadata.Bind.PropertySpan] = bindEntry.GetOriginalPropertySpan(); + changeNode.Annotations[ComponentMetadata.Bind.PropertySpan] = GetOriginalPropertySpan(changeNode); changeNode.Annotations[ComponentMetadata.Bind.IsSynthesized] = bool.TrueString; changeNode.AttributeName = changeAttributeName; changeNode.BoundAttribute = changeAttribute; // Might be null if it doesn't match a component attribute @@ -578,7 +578,7 @@ private IntermediateNode[] RewriteUsage(IntermediateNode parent, BindEntry bindE { var expressionNode = node != null ? new ComponentAttributeIntermediateNode(node) : new ComponentAttributeIntermediateNode(getNode); expressionNode.Annotations[ComponentMetadata.Common.OriginalAttributeName] = bindEntry.GetOriginalAttributeName(); - expressionNode.Annotations[ComponentMetadata.Bind.PropertySpan] = bindEntry.GetOriginalPropertySpan(); + expressionNode.Annotations[ComponentMetadata.Bind.PropertySpan] = GetOriginalPropertySpan(expressionNode); expressionNode.Annotations[ComponentMetadata.Bind.IsSynthesized] = bool.TrueString; expressionNode.AttributeName = expressionAttributeName; expressionNode.BoundAttribute = expressionAttribute; @@ -600,17 +600,17 @@ private IntermediateNode[] RewriteUsage(IntermediateNode parent, BindEntry bindE // We don't need to generate any runtime code for these attributes normally, as they're handled by the above nodes, // but in order for IDE scenarios around component attributes to work we need to generate a little bit of design // time code, so we create design time specific nodes with minimal information in order to do so. - TryAddDesignTimePropertyAccessHelperNode(builder, bindEntry.BindSetNode, valuePropertyName); - TryAddDesignTimePropertyAccessHelperNode(builder, bindEntry.BindEventNode, valuePropertyName); - TryAddDesignTimePropertyAccessHelperNode(builder, bindEntry.BindAfterNode, valuePropertyName); + TryAddDesignTimePropertyAccessHelperNode(builder, bindEntry.BindSetNode, valueAttribute); + TryAddDesignTimePropertyAccessHelperNode(builder, bindEntry.BindEventNode, valueAttribute); + TryAddDesignTimePropertyAccessHelperNode(builder, bindEntry.BindAfterNode, valueAttribute); return builder.ToArray(); } } - private static void TryAddDesignTimePropertyAccessHelperNode(ImmutableArray.Builder builder, TagHelperDirectiveAttributeParameterIntermediateNode intermediateNode, string propertyName) + private static void TryAddDesignTimePropertyAccessHelperNode(ImmutableArray.Builder builder, TagHelperDirectiveAttributeParameterIntermediateNode intermediateNode, BoundAttributeDescriptor valueAttribute) { - if (intermediateNode is null || propertyName is null) + if (intermediateNode is null || valueAttribute is null) { return; } @@ -618,8 +618,9 @@ private static void TryAddDesignTimePropertyAccessHelperNode(ImmutableArray BindNode?.TagHelper.GetChangeAttributeName() ?? BindGetNode?.TagHelper.GetChangeAttributeName(); public string GetEffectiveBindNodeExpressionAttributeName() => BindNode?.TagHelper.GetExpressionAttributeName() ?? BindGetNode?.TagHelper.GetExpressionAttributeName(); - - internal SourceSpan? GetOriginalPropertySpan() - { - var node = BindNode ?? (IntermediateNode)BindGetNode; - if (node?.Annotations[ComponentMetadata.Common.OriginalAttributeSpan] is SourceSpan attributeSourceSpan) - { - var offset = "bind-".Length; - return new SourceSpan(attributeSourceSpan.FilePath, - attributeSourceSpan.AbsoluteIndex + offset, - attributeSourceSpan.LineIndex, - attributeSourceSpan.CharacterIndex + offset, - attributeSourceSpan.Length - offset, - attributeSourceSpan.LineCount, - attributeSourceSpan.EndCharacterIndex); - } - return null; - } } } diff --git a/src/Compiler/Microsoft.CodeAnalysis.Razor.Compiler/src/Language/Components/ComponentRuntimeNodeWriter.cs b/src/Compiler/Microsoft.CodeAnalysis.Razor.Compiler/src/Language/Components/ComponentRuntimeNodeWriter.cs index 60bcc0287b7..692a2cee214 100644 --- a/src/Compiler/Microsoft.CodeAnalysis.Razor.Compiler/src/Language/Components/ComponentRuntimeNodeWriter.cs +++ b/src/Compiler/Microsoft.CodeAnalysis.Razor.Compiler/src/Language/Components/ComponentRuntimeNodeWriter.cs @@ -593,6 +593,7 @@ public override void WriteComponentAttribute(CodeRenderingContext context, Compo if (node.IsDesignTimePropertyAccessHelper()) { + WriteDesignTimePropertyAccessor(context, node); return; } @@ -625,6 +626,17 @@ public override void WriteComponentAttribute(CodeRenderingContext context, Compo context.CodeWriter.WriteLine(); } + private static void WriteDesignTimePropertyAccessor(CodeRenderingContext context, ComponentAttributeIntermediateNode attribute) + { + // These attributes don't really exist in the emitted code, but have a representation in the razor document. + // We emit a small piece of empty code that is elided by the compiler, so that the IDE has something to reference + // for Find All References etc. + Debug.Assert(attribute.BoundAttribute?.ContainingType is not null); + context.CodeWriter.Write(" _ = "); + WriteComponentAttributeName(context, attribute); + context.CodeWriter.WriteLine(";"); + } + private void WriteComponentAttributeInnards(CodeRenderingContext context, ComponentAttributeIntermediateNode node, bool canTypeCheck) { if (node.Children.Count > 1) From 310b32d8a5f7788103c92531b6aeaeaaf371a0ec Mon Sep 17 00:00:00 2001 From: Chris Sienkiewicz Date: Thu, 14 Nov 2024 15:20:25 -0800 Subject: [PATCH 2/3] Update baselines --- .../TestComponent.codegen.cs | 9 +++++++++ .../TestComponent.mappings.txt | 7 ++++++- .../TestComponent.codegen.cs | 9 +++++++++ .../TestComponent.mappings.txt | 7 ++++++- .../TestComponent.codegen.cs | 9 +++++++++ .../TestComponent.mappings.txt | 7 ++++++- .../TestComponent.codegen.cs | 9 +++++++++ .../TestComponent.mappings.txt | 7 ++++++- .../TestComponent.codegen.cs | 9 +++++++++ .../TestComponent.mappings.txt | 7 ++++++- .../TestComponent.codegen.cs | 9 +++++++++ .../TestComponent.mappings.txt | 7 ++++++- .../TestComponent.codegen.cs | 9 +++++++++ .../TestComponent.mappings.txt | 7 ++++++- .../TestComponent.codegen.cs | 9 +++++++++ .../TestComponent.mappings.txt | 7 ++++++- .../TestComponent.codegen.cs | 9 +++++++++ .../TestComponent.mappings.txt | 7 ++++++- .../TestComponent.codegen.cs | 9 +++++++++ .../TestComponent.mappings.txt | 7 ++++++- .../TestComponent.codegen.cs | 9 +++++++++ .../TestComponent.mappings.txt | 7 ++++++- .../TestComponent.codegen.cs | 9 +++++++++ .../TestComponent.mappings.txt | 7 ++++++- .../TestComponent.codegen.cs | 9 +++++++++ .../TestComponent.mappings.txt | 7 ++++++- .../TestComponent.codegen.cs | 9 +++++++++ .../TestComponent.mappings.txt | 7 ++++++- .../TestComponent.codegen.cs | 9 +++++++++ .../TestComponent.mappings.txt | 7 ++++++- .../TestComponent.codegen.cs | 9 +++++++++ .../TestComponent.mappings.txt | 7 ++++++- .../TestComponent.codegen.cs | 9 +++++++++ .../TestComponent.mappings.txt | 7 ++++++- .../TestComponent.codegen.cs | 9 +++++++++ .../TestComponent.mappings.txt | 7 ++++++- .../TestComponent.codegen.cs | 9 +++++++++ .../TestComponent.mappings.txt | 7 ++++++- .../TestComponent.codegen.cs | 9 +++++++++ .../TestComponent.mappings.txt | 7 ++++++- .../TestComponent.codegen.cs | 9 +++++++++ .../TestComponent.mappings.txt | 7 ++++++- .../TestComponent.codegen.cs | 9 +++++++++ .../TestComponent.mappings.txt | 7 ++++++- .../TestComponent.codegen.cs | 9 +++++++++ .../TestComponent.mappings.txt | 7 ++++++- .../TestComponent.codegen.cs | 9 +++++++++ .../TestComponent.mappings.txt | 7 ++++++- .../TestComponent.codegen.cs | 9 +++++++++ .../TestComponent.mappings.txt | 7 ++++++- 50 files changed, 375 insertions(+), 25 deletions(-) diff --git a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/BindToComponent_SpecifiesValueAndChangeEvent_WithMatchingProperties/TestComponent.codegen.cs b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/BindToComponent_SpecifiesValueAndChangeEvent_WithMatchingProperties/TestComponent.codegen.cs index d901af09592..ec6dd78b202 100644 --- a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/BindToComponent_SpecifiesValueAndChangeEvent_WithMatchingProperties/TestComponent.codegen.cs +++ b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/BindToComponent_SpecifiesValueAndChangeEvent_WithMatchingProperties/TestComponent.codegen.cs @@ -36,6 +36,15 @@ protected override void BuildRenderTree(global::Microsoft.AspNetCore.Components. #nullable disable )); __builder.AddComponentParameter(2, nameof(global::Test.MyComponent.OnChanged), (global::System.Action)(__value => ParentValue = __value)); + _ = nameof(global::Test.MyComponent. +#nullable restore +#line (1,46)-(1,51) "x:\dir\subdir\Test\TestComponent.cshtml" +Value + +#line default +#line hidden +#nullable disable + ); __builder.CloseComponent(); } #pragma warning restore 1998 diff --git a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/BindToComponent_SpecifiesValueAndChangeEvent_WithMatchingProperties/TestComponent.mappings.txt b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/BindToComponent_SpecifiesValueAndChangeEvent_WithMatchingProperties/TestComponent.mappings.txt index 43bc0751867..ea29ab07b34 100644 --- a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/BindToComponent_SpecifiesValueAndChangeEvent_WithMatchingProperties/TestComponent.mappings.txt +++ b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/BindToComponent_SpecifiesValueAndChangeEvent_WithMatchingProperties/TestComponent.mappings.txt @@ -8,11 +8,16 @@ Source Location: (26:0,26 [11] x:\dir\subdir\Test\TestComponent.cshtml) Generated Location: (1144:31,0 [11] ) |ParentValue| +Source Location: (45:0,45 [5] x:\dir\subdir\Test\TestComponent.cshtml) +|Value| +Generated Location: (1531:41,0 [5] ) +|Value| + Source Location: (80:1,7 [50] x:\dir\subdir\Test\TestComponent.cshtml) | public int ParentValue { get; set; } = 42; | -Generated Location: (1568:43,0 [50] ) +Generated Location: (1774:52,0 [50] ) | public int ParentValue { get; set; } = 42; | diff --git a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/BindToComponent_WithAfter_Action/TestComponent.codegen.cs b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/BindToComponent_WithAfter_Action/TestComponent.codegen.cs index 1f8135dd3dc..1b07b53a23c 100644 --- a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/BindToComponent_WithAfter_Action/TestComponent.codegen.cs +++ b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/BindToComponent_WithAfter_Action/TestComponent.codegen.cs @@ -44,6 +44,15 @@ protected override void BuildRenderTree(global::Microsoft.AspNetCore.Components. #line hidden #nullable disable ); })); + _ = nameof(global::Test.MyComponent. +#nullable restore +#line (1,50)-(1,55) "x:\dir\subdir\Test\TestComponent.cshtml" +Value + +#line default +#line hidden +#nullable disable + ); __builder.CloseComponent(); } #pragma warning restore 1998 diff --git a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/BindToComponent_WithAfter_Action/TestComponent.mappings.txt b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/BindToComponent_WithAfter_Action/TestComponent.mappings.txt index 810b5101f39..1ae651b179d 100644 --- a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/BindToComponent_WithAfter_Action/TestComponent.mappings.txt +++ b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/BindToComponent_WithAfter_Action/TestComponent.mappings.txt @@ -13,13 +13,18 @@ Source Location: (62:0,62 [6] x:\dir\subdir\Test\TestComponent.cshtml) Generated Location: (1583:40,0 [6] ) |Update| +Source Location: (49:0,49 [5] x:\dir\subdir\Test\TestComponent.cshtml) +|Value| +Generated Location: (1795:49,0 [5] ) +|Value| + Source Location: (81:1,7 [82] x:\dir\subdir\Test\TestComponent.cshtml) | public int ParentValue { get; set; } = 42; public void Update() { } | -Generated Location: (1832:51,0 [82] ) +Generated Location: (2038:60,0 [82] ) | public int ParentValue { get; set; } = 42; diff --git a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/BindToComponent_WithAfter_ActionLambda/TestComponent.codegen.cs b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/BindToComponent_WithAfter_ActionLambda/TestComponent.codegen.cs index f386b9d2740..7eef98c6795 100644 --- a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/BindToComponent_WithAfter_ActionLambda/TestComponent.codegen.cs +++ b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/BindToComponent_WithAfter_ActionLambda/TestComponent.codegen.cs @@ -44,6 +44,15 @@ protected override void BuildRenderTree(global::Microsoft.AspNetCore.Components. #line hidden #nullable disable ); })); + _ = nameof(global::Test.MyComponent. +#nullable restore +#line (1,50)-(1,55) "x:\dir\subdir\Test\TestComponent.cshtml" +Value + +#line default +#line hidden +#nullable disable + ); __builder.CloseComponent(); } #pragma warning restore 1998 diff --git a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/BindToComponent_WithAfter_ActionLambda/TestComponent.mappings.txt b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/BindToComponent_WithAfter_ActionLambda/TestComponent.mappings.txt index 8240e570289..73db4055c37 100644 --- a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/BindToComponent_WithAfter_ActionLambda/TestComponent.mappings.txt +++ b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/BindToComponent_WithAfter_ActionLambda/TestComponent.mappings.txt @@ -13,11 +13,16 @@ Source Location: (62:0,62 [9] x:\dir\subdir\Test\TestComponent.cshtml) Generated Location: (1583:40,0 [9] ) |() => { }| +Source Location: (49:0,49 [5] x:\dir\subdir\Test\TestComponent.cshtml) +|Value| +Generated Location: (1798:49,0 [5] ) +|Value| + Source Location: (84:1,7 [50] x:\dir\subdir\Test\TestComponent.cshtml) | public int ParentValue { get; set; } = 42; | -Generated Location: (1835:51,0 [50] ) +Generated Location: (2041:60,0 [50] ) | public int ParentValue { get; set; } = 42; | diff --git a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/BindToComponent_WithAfter_AsyncLambdaProducesError/TestComponent.codegen.cs b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/BindToComponent_WithAfter_AsyncLambdaProducesError/TestComponent.codegen.cs index 1bf6800bda0..798e4f597cb 100644 --- a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/BindToComponent_WithAfter_AsyncLambdaProducesError/TestComponent.codegen.cs +++ b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/BindToComponent_WithAfter_AsyncLambdaProducesError/TestComponent.codegen.cs @@ -44,6 +44,15 @@ protected override void BuildRenderTree(global::Microsoft.AspNetCore.Components. #line hidden #nullable disable )); + _ = nameof(global::Test.MyComponent. +#nullable restore +#line (1,50)-(1,55) "x:\dir\subdir\Test\TestComponent.cshtml" +Value + +#line default +#line hidden +#nullable disable + ); __builder.CloseComponent(); } #pragma warning restore 1998 diff --git a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/BindToComponent_WithAfter_AsyncLambdaProducesError/TestComponent.mappings.txt b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/BindToComponent_WithAfter_AsyncLambdaProducesError/TestComponent.mappings.txt index 586a029c535..bc78a40eef2 100644 --- a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/BindToComponent_WithAfter_AsyncLambdaProducesError/TestComponent.mappings.txt +++ b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/BindToComponent_WithAfter_AsyncLambdaProducesError/TestComponent.mappings.txt @@ -13,11 +13,16 @@ Source Location: (60:0,60 [62] x:\dir\subdir\Test\TestComponent.cshtml) Generated Location: (1449:40,0 [62] ) |(value => { ParentValue = value; return Task.CompletedTask; })| +Source Location: (49:0,49 [5] x:\dir\subdir\Test\TestComponent.cshtml) +|Value| +Generated Location: (1713:49,0 [5] ) +|Value| + Source Location: (135:1,7 [50] x:\dir\subdir\Test\TestComponent.cshtml) | public int ParentValue { get; set; } = 42; | -Generated Location: (1750:51,0 [50] ) +Generated Location: (1956:60,0 [50] ) | public int ParentValue { get; set; } = 42; | diff --git a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/BindToComponent_WithAfter_EventCallback/TestComponent.codegen.cs b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/BindToComponent_WithAfter_EventCallback/TestComponent.codegen.cs index 1c11101a1ab..9279a9c2136 100644 --- a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/BindToComponent_WithAfter_EventCallback/TestComponent.codegen.cs +++ b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/BindToComponent_WithAfter_EventCallback/TestComponent.codegen.cs @@ -44,6 +44,15 @@ protected override void BuildRenderTree(global::Microsoft.AspNetCore.Components. #line hidden #nullable disable ); }, value: ParentValue), ParentValue)))); + _ = nameof(global::Test.MyComponent. +#nullable restore +#line (1,50)-(1,55) "x:\dir\subdir\Test\TestComponent.cshtml" +Value + +#line default +#line hidden +#nullable disable + ); __builder.CloseComponent(); } #pragma warning restore 1998 diff --git a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/BindToComponent_WithAfter_EventCallback/TestComponent.mappings.txt b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/BindToComponent_WithAfter_EventCallback/TestComponent.mappings.txt index 0ebff81e87b..b7073694cb7 100644 --- a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/BindToComponent_WithAfter_EventCallback/TestComponent.mappings.txt +++ b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/BindToComponent_WithAfter_EventCallback/TestComponent.mappings.txt @@ -13,12 +13,17 @@ Source Location: (62:0,62 [11] x:\dir\subdir\Test\TestComponent.cshtml) Generated Location: (2023:40,0 [11] ) |UpdateValue| +Source Location: (49:0,49 [5] x:\dir\subdir\Test\TestComponent.cshtml) +|Value| +Generated Location: (2276:49,0 [5] ) +|Value| + Source Location: (86:1,7 [102] x:\dir\subdir\Test\TestComponent.cshtml) | public int ParentValue { get; set; } = 42; public EventCallback UpdateValue { get; set; } | -Generated Location: (2313:51,0 [102] ) +Generated Location: (2519:60,0 [102] ) | public int ParentValue { get; set; } = 42; public EventCallback UpdateValue { get; set; } diff --git a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/BindToComponent_WithAfter_EventCallback_ReceivesAction/TestComponent.codegen.cs b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/BindToComponent_WithAfter_EventCallback_ReceivesAction/TestComponent.codegen.cs index 7aa10176bf4..a0237e0dc32 100644 --- a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/BindToComponent_WithAfter_EventCallback_ReceivesAction/TestComponent.codegen.cs +++ b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/BindToComponent_WithAfter_EventCallback_ReceivesAction/TestComponent.codegen.cs @@ -44,6 +44,15 @@ protected override void BuildRenderTree(global::Microsoft.AspNetCore.Components. #line hidden #nullable disable ); }, value: ParentValue), ParentValue)))); + _ = nameof(global::Test.MyComponent. +#nullable restore +#line (1,50)-(1,55) "x:\dir\subdir\Test\TestComponent.cshtml" +Value + +#line default +#line hidden +#nullable disable + ); __builder.CloseComponent(); } #pragma warning restore 1998 diff --git a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/BindToComponent_WithAfter_EventCallback_ReceivesAction/TestComponent.mappings.txt b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/BindToComponent_WithAfter_EventCallback_ReceivesAction/TestComponent.mappings.txt index 209c01f92d6..441550dee99 100644 --- a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/BindToComponent_WithAfter_EventCallback_ReceivesAction/TestComponent.mappings.txt +++ b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/BindToComponent_WithAfter_EventCallback_ReceivesAction/TestComponent.mappings.txt @@ -13,11 +13,16 @@ Source Location: (62:0,62 [9] x:\dir\subdir\Test\TestComponent.cshtml) Generated Location: (2023:40,0 [9] ) |() => { }| +Source Location: (49:0,49 [5] x:\dir\subdir\Test\TestComponent.cshtml) +|Value| +Generated Location: (2274:49,0 [5] ) +|Value| + Source Location: (84:1,7 [50] x:\dir\subdir\Test\TestComponent.cshtml) | public int ParentValue { get; set; } = 42; | -Generated Location: (2311:51,0 [50] ) +Generated Location: (2517:60,0 [50] ) | public int ParentValue { get; set; } = 42; | diff --git a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/BindToComponent_WithAfter_EventCallback_ReceivesFunction/TestComponent.codegen.cs b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/BindToComponent_WithAfter_EventCallback_ReceivesFunction/TestComponent.codegen.cs index 40880f13c2d..3b1f2f3d1ac 100644 --- a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/BindToComponent_WithAfter_EventCallback_ReceivesFunction/TestComponent.codegen.cs +++ b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/BindToComponent_WithAfter_EventCallback_ReceivesFunction/TestComponent.codegen.cs @@ -44,6 +44,15 @@ protected override void BuildRenderTree(global::Microsoft.AspNetCore.Components. #line hidden #nullable disable ); }, value: ParentValue), ParentValue)))); + _ = nameof(global::Test.MyComponent. +#nullable restore +#line (1,50)-(1,55) "x:\dir\subdir\Test\TestComponent.cshtml" +Value + +#line default +#line hidden +#nullable disable + ); __builder.CloseComponent(); } #pragma warning restore 1998 diff --git a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/BindToComponent_WithAfter_EventCallback_ReceivesFunction/TestComponent.mappings.txt b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/BindToComponent_WithAfter_EventCallback_ReceivesFunction/TestComponent.mappings.txt index 41bd0f9bb1e..6d6b59173c9 100644 --- a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/BindToComponent_WithAfter_EventCallback_ReceivesFunction/TestComponent.mappings.txt +++ b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/BindToComponent_WithAfter_EventCallback_ReceivesFunction/TestComponent.mappings.txt @@ -13,13 +13,18 @@ Source Location: (62:0,62 [11] x:\dir\subdir\Test\TestComponent.cshtml) Generated Location: (2023:40,0 [11] ) |UpdateValue| +Source Location: (49:0,49 [5] x:\dir\subdir\Test\TestComponent.cshtml) +|Value| +Generated Location: (2276:49,0 [5] ) +|Value| + Source Location: (86:1,7 [106] x:\dir\subdir\Test\TestComponent.cshtml) | public int ParentValue { get; set; } = 42; public Task UpdateValue() => Task.CompletedTask; | -Generated Location: (2313:51,0 [106] ) +Generated Location: (2519:60,0 [106] ) | public int ParentValue { get; set; } = 42; diff --git a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/BindToComponent_WithAfter_TaskReturningDelegate/TestComponent.codegen.cs b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/BindToComponent_WithAfter_TaskReturningDelegate/TestComponent.codegen.cs index bb422b76863..fa4909015ba 100644 --- a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/BindToComponent_WithAfter_TaskReturningDelegate/TestComponent.codegen.cs +++ b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/BindToComponent_WithAfter_TaskReturningDelegate/TestComponent.codegen.cs @@ -44,6 +44,15 @@ protected override void BuildRenderTree(global::Microsoft.AspNetCore.Components. #line hidden #nullable disable ); })); + _ = nameof(global::Test.MyComponent. +#nullable restore +#line (1,50)-(1,55) "x:\dir\subdir\Test\TestComponent.cshtml" +Value + +#line default +#line hidden +#nullable disable + ); __builder.CloseComponent(); } #pragma warning restore 1998 diff --git a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/BindToComponent_WithAfter_TaskReturningDelegate/TestComponent.mappings.txt b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/BindToComponent_WithAfter_TaskReturningDelegate/TestComponent.mappings.txt index 4b6ab91b9d3..6ad7c6c4259 100644 --- a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/BindToComponent_WithAfter_TaskReturningDelegate/TestComponent.mappings.txt +++ b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/BindToComponent_WithAfter_TaskReturningDelegate/TestComponent.mappings.txt @@ -13,13 +13,18 @@ Source Location: (62:0,62 [6] x:\dir\subdir\Test\TestComponent.cshtml) Generated Location: (1631:40,0 [6] ) |Update| +Source Location: (49:0,49 [5] x:\dir\subdir\Test\TestComponent.cshtml) +|Value| +Generated Location: (1843:49,0 [5] ) +|Value| + Source Location: (81:1,7 [101] x:\dir\subdir\Test\TestComponent.cshtml) | public int ParentValue { get; set; } = 42; public Task Update() => Task.CompletedTask; | -Generated Location: (1880:51,0 [101] ) +Generated Location: (2086:60,0 [101] ) | public int ParentValue { get; set; } = 42; diff --git a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/BindToComponent_WithAfter_TaskReturningLambda/TestComponent.codegen.cs b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/BindToComponent_WithAfter_TaskReturningLambda/TestComponent.codegen.cs index c925f792b53..2913a3488c6 100644 --- a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/BindToComponent_WithAfter_TaskReturningLambda/TestComponent.codegen.cs +++ b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/BindToComponent_WithAfter_TaskReturningLambda/TestComponent.codegen.cs @@ -44,6 +44,15 @@ protected override void BuildRenderTree(global::Microsoft.AspNetCore.Components. #line hidden #nullable disable ); })); + _ = nameof(global::Test.MyComponent. +#nullable restore +#line (1,50)-(1,55) "x:\dir\subdir\Test\TestComponent.cshtml" +Value + +#line default +#line hidden +#nullable disable + ); __builder.CloseComponent(); } #pragma warning restore 1998 diff --git a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/BindToComponent_WithAfter_TaskReturningLambda/TestComponent.mappings.txt b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/BindToComponent_WithAfter_TaskReturningLambda/TestComponent.mappings.txt index 24f207033e2..59ca2eadbbe 100644 --- a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/BindToComponent_WithAfter_TaskReturningLambda/TestComponent.mappings.txt +++ b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/BindToComponent_WithAfter_TaskReturningLambda/TestComponent.mappings.txt @@ -13,11 +13,16 @@ Source Location: (62:0,62 [36] x:\dir\subdir\Test\TestComponent.cshtml) Generated Location: (1631:40,0 [36] ) |() => { return Task.CompletedTask; }| +Source Location: (49:0,49 [5] x:\dir\subdir\Test\TestComponent.cshtml) +|Value| +Generated Location: (1873:49,0 [5] ) +|Value| + Source Location: (111:1,7 [50] x:\dir\subdir\Test\TestComponent.cshtml) | public int ParentValue { get; set; } = 42; | -Generated Location: (1910:51,0 [50] ) +Generated Location: (2116:60,0 [50] ) | public int ParentValue { get; set; } = 42; | diff --git a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/BindToComponent_WithGetSet_Action/TestComponent.codegen.cs b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/BindToComponent_WithGetSet_Action/TestComponent.codegen.cs index 6e26b464c7b..dce6e9654fc 100644 --- a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/BindToComponent_WithGetSet_Action/TestComponent.codegen.cs +++ b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/BindToComponent_WithGetSet_Action/TestComponent.codegen.cs @@ -44,6 +44,15 @@ protected override void BuildRenderTree(global::Microsoft.AspNetCore.Components. #line hidden #nullable disable )); + _ = nameof(global::Test.MyComponent. +#nullable restore +#line (1,50)-(1,55) "x:\dir\subdir\Test\TestComponent.cshtml" +Value + +#line default +#line hidden +#nullable disable + ); __builder.CloseComponent(); } #pragma warning restore 1998 diff --git a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/BindToComponent_WithGetSet_Action/TestComponent.mappings.txt b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/BindToComponent_WithGetSet_Action/TestComponent.mappings.txt index a04298cae65..17dbb1926fe 100644 --- a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/BindToComponent_WithGetSet_Action/TestComponent.mappings.txt +++ b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/BindToComponent_WithGetSet_Action/TestComponent.mappings.txt @@ -13,13 +13,18 @@ Source Location: (60:0,60 [11] x:\dir\subdir\Test\TestComponent.cshtml) Generated Location: (1448:40,0 [11] ) |UpdateValue| +Source Location: (49:0,49 [5] x:\dir\subdir\Test\TestComponent.cshtml) +|Value| +Generated Location: (1661:49,0 [5] ) +|Value| + Source Location: (84:1,7 [116] x:\dir\subdir\Test\TestComponent.cshtml) | public int ParentValue { get; set; } = 42; public void UpdateValue(int value) => ParentValue = value; | -Generated Location: (1698:51,0 [116] ) +Generated Location: (1904:60,0 [116] ) | public int ParentValue { get; set; } = 42; diff --git a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/BindToComponent_WithGetSet_ActionLambda/TestComponent.codegen.cs b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/BindToComponent_WithGetSet_ActionLambda/TestComponent.codegen.cs index 96ff2c3df0f..b6ee82543aa 100644 --- a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/BindToComponent_WithGetSet_ActionLambda/TestComponent.codegen.cs +++ b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/BindToComponent_WithGetSet_ActionLambda/TestComponent.codegen.cs @@ -44,6 +44,15 @@ protected override void BuildRenderTree(global::Microsoft.AspNetCore.Components. #line hidden #nullable disable )); + _ = nameof(global::Test.MyComponent. +#nullable restore +#line (1,50)-(1,55) "x:\dir\subdir\Test\TestComponent.cshtml" +Value + +#line default +#line hidden +#nullable disable + ); __builder.CloseComponent(); } #pragma warning restore 1998 diff --git a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/BindToComponent_WithGetSet_ActionLambda/TestComponent.mappings.txt b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/BindToComponent_WithGetSet_ActionLambda/TestComponent.mappings.txt index 4240393425d..4869616d0f8 100644 --- a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/BindToComponent_WithGetSet_ActionLambda/TestComponent.mappings.txt +++ b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/BindToComponent_WithGetSet_ActionLambda/TestComponent.mappings.txt @@ -13,11 +13,16 @@ Source Location: (60:0,60 [28] x:\dir\subdir\Test\TestComponent.cshtml) Generated Location: (1448:40,0 [28] ) |value => ParentValue = value| +Source Location: (49:0,49 [5] x:\dir\subdir\Test\TestComponent.cshtml) +|Value| +Generated Location: (1678:49,0 [5] ) +|Value| + Source Location: (101:1,7 [50] x:\dir\subdir\Test\TestComponent.cshtml) | public int ParentValue { get; set; } = 42; | -Generated Location: (1715:51,0 [50] ) +Generated Location: (1921:60,0 [50] ) | public int ParentValue { get; set; } = 42; | diff --git a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/BindToComponent_WithGetSet_EventCallback/TestComponent.codegen.cs b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/BindToComponent_WithGetSet_EventCallback/TestComponent.codegen.cs index f38e790ecc9..e756390bc53 100644 --- a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/BindToComponent_WithGetSet_EventCallback/TestComponent.codegen.cs +++ b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/BindToComponent_WithGetSet_EventCallback/TestComponent.codegen.cs @@ -44,6 +44,15 @@ protected override void BuildRenderTree(global::Microsoft.AspNetCore.Components. #line hidden #nullable disable , ParentValue)))); + _ = nameof(global::Test.MyComponent. +#nullable restore +#line (1,50)-(1,55) "x:\dir\subdir\Test\TestComponent.cshtml" +Value + +#line default +#line hidden +#nullable disable + ); __builder.CloseComponent(); } #pragma warning restore 1998 diff --git a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/BindToComponent_WithGetSet_EventCallback/TestComponent.mappings.txt b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/BindToComponent_WithGetSet_EventCallback/TestComponent.mappings.txt index b413cf157c5..b87605cb8ff 100644 --- a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/BindToComponent_WithGetSet_EventCallback/TestComponent.mappings.txt +++ b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/BindToComponent_WithGetSet_EventCallback/TestComponent.mappings.txt @@ -13,12 +13,17 @@ Source Location: (60:0,60 [11] x:\dir\subdir\Test\TestComponent.cshtml) Generated Location: (1764:40,0 [11] ) |UpdateValue| +Source Location: (49:0,49 [5] x:\dir\subdir\Test\TestComponent.cshtml) +|Value| +Generated Location: (1992:49,0 [5] ) +|Value| + Source Location: (84:1,7 [107] x:\dir\subdir\Test\TestComponent.cshtml) | public int ParentValue { get; set; } = 42; public EventCallback UpdateValue { get; set; } | -Generated Location: (2029:51,0 [107] ) +Generated Location: (2235:60,0 [107] ) | public int ParentValue { get; set; } = 42; public EventCallback UpdateValue { get; set; } diff --git a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/BindToComponent_WithGetSet_EventCallback_ReceivesAction/TestComponent.codegen.cs b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/BindToComponent_WithGetSet_EventCallback_ReceivesAction/TestComponent.codegen.cs index 8613bc60122..e44e2cf76e1 100644 --- a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/BindToComponent_WithGetSet_EventCallback_ReceivesAction/TestComponent.codegen.cs +++ b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/BindToComponent_WithGetSet_EventCallback_ReceivesAction/TestComponent.codegen.cs @@ -44,6 +44,15 @@ protected override void BuildRenderTree(global::Microsoft.AspNetCore.Components. #line hidden #nullable disable , ParentValue)))); + _ = nameof(global::Test.MyComponent. +#nullable restore +#line (1,50)-(1,55) "x:\dir\subdir\Test\TestComponent.cshtml" +Value + +#line default +#line hidden +#nullable disable + ); __builder.CloseComponent(); } #pragma warning restore 1998 diff --git a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/BindToComponent_WithGetSet_EventCallback_ReceivesAction/TestComponent.mappings.txt b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/BindToComponent_WithGetSet_EventCallback_ReceivesAction/TestComponent.mappings.txt index d257b6e5d75..2be57a01987 100644 --- a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/BindToComponent_WithGetSet_EventCallback_ReceivesAction/TestComponent.mappings.txt +++ b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/BindToComponent_WithGetSet_EventCallback_ReceivesAction/TestComponent.mappings.txt @@ -13,11 +13,16 @@ Source Location: (60:0,60 [28] x:\dir\subdir\Test\TestComponent.cshtml) Generated Location: (1764:40,0 [28] ) |value => ParentValue = value| +Source Location: (49:0,49 [5] x:\dir\subdir\Test\TestComponent.cshtml) +|Value| +Generated Location: (2009:49,0 [5] ) +|Value| + Source Location: (101:1,7 [50] x:\dir\subdir\Test\TestComponent.cshtml) | public int ParentValue { get; set; } = 42; | -Generated Location: (2046:51,0 [50] ) +Generated Location: (2252:60,0 [50] ) | public int ParentValue { get; set; } = 42; | diff --git a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/BindToComponent_WithGetSet_EventCallback_ReceivesFunction/TestComponent.codegen.cs b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/BindToComponent_WithGetSet_EventCallback_ReceivesFunction/TestComponent.codegen.cs index 704445d77e2..65e7e2d0deb 100644 --- a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/BindToComponent_WithGetSet_EventCallback_ReceivesFunction/TestComponent.codegen.cs +++ b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/BindToComponent_WithGetSet_EventCallback_ReceivesFunction/TestComponent.codegen.cs @@ -44,6 +44,15 @@ protected override void BuildRenderTree(global::Microsoft.AspNetCore.Components. #line hidden #nullable disable , ParentValue)))); + _ = nameof(global::Test.MyComponent. +#nullable restore +#line (1,50)-(1,55) "x:\dir\subdir\Test\TestComponent.cshtml" +Value + +#line default +#line hidden +#nullable disable + ); __builder.CloseComponent(); } #pragma warning restore 1998 diff --git a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/BindToComponent_WithGetSet_EventCallback_ReceivesFunction/TestComponent.mappings.txt b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/BindToComponent_WithGetSet_EventCallback_ReceivesFunction/TestComponent.mappings.txt index b2213b40f24..5ceb247b2a0 100644 --- a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/BindToComponent_WithGetSet_EventCallback_ReceivesFunction/TestComponent.mappings.txt +++ b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/BindToComponent_WithGetSet_EventCallback_ReceivesFunction/TestComponent.mappings.txt @@ -13,13 +13,18 @@ Source Location: (60:0,60 [11] x:\dir\subdir\Test\TestComponent.cshtml) Generated Location: (1764:40,0 [11] ) |UpdateValue| +Source Location: (49:0,49 [5] x:\dir\subdir\Test\TestComponent.cshtml) +|Value| +Generated Location: (1992:49,0 [5] ) +|Value| + Source Location: (84:1,7 [144] x:\dir\subdir\Test\TestComponent.cshtml) | public int ParentValue { get; set; } = 42; public Task UpdateValue(int value) { ParentValue = value; return Task.CompletedTask; } | -Generated Location: (2029:51,0 [144] ) +Generated Location: (2235:60,0 [144] ) | public int ParentValue { get; set; } = 42; diff --git a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/BindToComponent_WithGetSet_ProducesErrorOnOlderLanguageVersions/TestComponent.codegen.cs b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/BindToComponent_WithGetSet_ProducesErrorOnOlderLanguageVersions/TestComponent.codegen.cs index 0edba25ee85..7e87ec82e05 100644 --- a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/BindToComponent_WithGetSet_ProducesErrorOnOlderLanguageVersions/TestComponent.codegen.cs +++ b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/BindToComponent_WithGetSet_ProducesErrorOnOlderLanguageVersions/TestComponent.codegen.cs @@ -44,6 +44,15 @@ protected override void BuildRenderTree(global::Microsoft.AspNetCore.Components. #line hidden #nullable disable ))); + _ = nameof(global::Test.MyComponent. +#nullable restore +#line (1,50)-(1,55) "x:\dir\subdir\Test\TestComponent.cshtml" +Value + +#line default +#line hidden +#nullable disable + ); __builder.CloseComponent(); } #pragma warning restore 1998 diff --git a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/BindToComponent_WithGetSet_ProducesErrorOnOlderLanguageVersions/TestComponent.mappings.txt b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/BindToComponent_WithGetSet_ProducesErrorOnOlderLanguageVersions/TestComponent.mappings.txt index cf93f168453..6744de090ab 100644 --- a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/BindToComponent_WithGetSet_ProducesErrorOnOlderLanguageVersions/TestComponent.mappings.txt +++ b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/BindToComponent_WithGetSet_ProducesErrorOnOlderLanguageVersions/TestComponent.mappings.txt @@ -13,13 +13,18 @@ Source Location: (60:0,60 [11] x:\dir\subdir\Test\TestComponent.cshtml) Generated Location: (1449:40,0 [11] ) |UpdateValue| +Source Location: (49:0,49 [5] x:\dir\subdir\Test\TestComponent.cshtml) +|Value| +Generated Location: (1663:49,0 [5] ) +|Value| + Source Location: (84:1,7 [116] x:\dir\subdir\Test\TestComponent.cshtml) | public int ParentValue { get; set; } = 42; public void UpdateValue(int value) => ParentValue = value; | -Generated Location: (1700:51,0 [116] ) +Generated Location: (1906:60,0 [116] ) | public int ParentValue { get; set; } = 42; diff --git a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/BindToComponent_WithGetSet_TaskReturningDelegate/TestComponent.codegen.cs b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/BindToComponent_WithGetSet_TaskReturningDelegate/TestComponent.codegen.cs index 3d8becd8513..cb493dc0b24 100644 --- a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/BindToComponent_WithGetSet_TaskReturningDelegate/TestComponent.codegen.cs +++ b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/BindToComponent_WithGetSet_TaskReturningDelegate/TestComponent.codegen.cs @@ -44,6 +44,15 @@ protected override void BuildRenderTree(global::Microsoft.AspNetCore.Components. #line hidden #nullable disable )); + _ = nameof(global::Test.MyComponent. +#nullable restore +#line (1,50)-(1,55) "x:\dir\subdir\Test\TestComponent.cshtml" +Value + +#line default +#line hidden +#nullable disable + ); __builder.CloseComponent(); } #pragma warning restore 1998 diff --git a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/BindToComponent_WithGetSet_TaskReturningDelegate/TestComponent.mappings.txt b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/BindToComponent_WithGetSet_TaskReturningDelegate/TestComponent.mappings.txt index 1d2d804a1b9..f993cc40585 100644 --- a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/BindToComponent_WithGetSet_TaskReturningDelegate/TestComponent.mappings.txt +++ b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/BindToComponent_WithGetSet_TaskReturningDelegate/TestComponent.mappings.txt @@ -13,13 +13,18 @@ Source Location: (60:0,60 [11] x:\dir\subdir\Test\TestComponent.cshtml) Generated Location: (1483:40,0 [11] ) |UpdateValue| +Source Location: (49:0,49 [5] x:\dir\subdir\Test\TestComponent.cshtml) +|Value| +Generated Location: (1696:49,0 [5] ) +|Value| + Source Location: (84:1,7 [144] x:\dir\subdir\Test\TestComponent.cshtml) | public int ParentValue { get; set; } = 42; public Task UpdateValue(int value) { ParentValue = value; return Task.CompletedTask; } | -Generated Location: (1733:51,0 [144] ) +Generated Location: (1939:60,0 [144] ) | public int ParentValue { get; set; } = 42; diff --git a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/BindToComponent_WithGetSet_TaskReturningLambda/TestComponent.codegen.cs b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/BindToComponent_WithGetSet_TaskReturningLambda/TestComponent.codegen.cs index 47034cd4373..a9cb063702c 100644 --- a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/BindToComponent_WithGetSet_TaskReturningLambda/TestComponent.codegen.cs +++ b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/BindToComponent_WithGetSet_TaskReturningLambda/TestComponent.codegen.cs @@ -44,6 +44,15 @@ protected override void BuildRenderTree(global::Microsoft.AspNetCore.Components. #line hidden #nullable disable )); + _ = nameof(global::Test.MyComponent. +#nullable restore +#line (1,50)-(1,55) "x:\dir\subdir\Test\TestComponent.cshtml" +Value + +#line default +#line hidden +#nullable disable + ); __builder.CloseComponent(); } #pragma warning restore 1998 diff --git a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/BindToComponent_WithGetSet_TaskReturningLambda/TestComponent.mappings.txt b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/BindToComponent_WithGetSet_TaskReturningLambda/TestComponent.mappings.txt index 15ba3e4b8a4..6ba6adcfabf 100644 --- a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/BindToComponent_WithGetSet_TaskReturningLambda/TestComponent.mappings.txt +++ b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/BindToComponent_WithGetSet_TaskReturningLambda/TestComponent.mappings.txt @@ -13,11 +13,16 @@ Source Location: (60:0,60 [60] x:\dir\subdir\Test\TestComponent.cshtml) Generated Location: (1484:40,0 [60] ) |value => { ParentValue = value; return Task.CompletedTask; }| +Source Location: (49:0,49 [5] x:\dir\subdir\Test\TestComponent.cshtml) +|Value| +Generated Location: (1746:49,0 [5] ) +|Value| + Source Location: (133:1,7 [50] x:\dir\subdir\Test\TestComponent.cshtml) | public int ParentValue { get; set; } = 42; | -Generated Location: (1783:51,0 [50] ) +Generated Location: (1989:60,0 [50] ) | public int ParentValue { get; set; } = 42; | diff --git a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/BindToGenericComponent_ExplicitType_WithAfter_Action/TestComponent.codegen.cs b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/BindToGenericComponent_ExplicitType_WithAfter_Action/TestComponent.codegen.cs index b7ff3201d11..ab08e5ff407 100644 --- a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/BindToGenericComponent_ExplicitType_WithAfter_Action/TestComponent.codegen.cs +++ b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/BindToGenericComponent_ExplicitType_WithAfter_Action/TestComponent.codegen.cs @@ -44,6 +44,15 @@ protected override void BuildRenderTree(global::Microsoft.AspNetCore.Components. #line hidden #nullable disable ); })); + _ = nameof(global::Test.MyComponent. +#nullable restore +#line (1,63)-(1,68) "x:\dir\subdir\Test\TestComponent.cshtml" +Value + +#line default +#line hidden +#nullable disable + ); __builder.CloseComponent(); } #pragma warning restore 1998 diff --git a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/BindToGenericComponent_ExplicitType_WithAfter_Action/TestComponent.mappings.txt b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/BindToGenericComponent_ExplicitType_WithAfter_Action/TestComponent.mappings.txt index f0784640e1a..08aa4e26ecc 100644 --- a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/BindToGenericComponent_ExplicitType_WithAfter_Action/TestComponent.mappings.txt +++ b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/BindToGenericComponent_ExplicitType_WithAfter_Action/TestComponent.mappings.txt @@ -13,13 +13,18 @@ Source Location: (75:0,75 [6] x:\dir\subdir\Test\TestComponent.cshtml) Generated Location: (1564:40,0 [6] ) |Update| +Source Location: (62:0,62 [5] x:\dir\subdir\Test\TestComponent.cshtml) +|Value| +Generated Location: (1781:49,0 [5] ) +|Value| + Source Location: (94:1,7 [82] x:\dir\subdir\Test\TestComponent.cshtml) | public int ParentValue { get; set; } = 42; public void Update() { } | -Generated Location: (1813:51,0 [82] ) +Generated Location: (2024:60,0 [82] ) | public int ParentValue { get; set; } = 42; diff --git a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/BindToGenericComponent_ExplicitType_WithGetSet_Action/TestComponent.codegen.cs b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/BindToGenericComponent_ExplicitType_WithGetSet_Action/TestComponent.codegen.cs index 8a4db3328d6..c7bee6fd507 100644 --- a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/BindToGenericComponent_ExplicitType_WithGetSet_Action/TestComponent.codegen.cs +++ b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/BindToGenericComponent_ExplicitType_WithGetSet_Action/TestComponent.codegen.cs @@ -44,6 +44,15 @@ protected override void BuildRenderTree(global::Microsoft.AspNetCore.Components. #line hidden #nullable disable , ParentValue)))); + _ = nameof(global::Test.MyComponent. +#nullable restore +#line (1,71)-(1,76) "x:\dir\subdir\Test\TestComponent.cshtml" +Value + +#line default +#line hidden +#nullable disable + ); __builder.CloseComponent(); } #pragma warning restore 1998 diff --git a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/BindToGenericComponent_ExplicitType_WithGetSet_Action/TestComponent.mappings.txt b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/BindToGenericComponent_ExplicitType_WithGetSet_Action/TestComponent.mappings.txt index 84d48326884..115db22201c 100644 --- a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/BindToGenericComponent_ExplicitType_WithGetSet_Action/TestComponent.mappings.txt +++ b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/BindToGenericComponent_ExplicitType_WithGetSet_Action/TestComponent.mappings.txt @@ -13,13 +13,18 @@ Source Location: (81:0,81 [11] x:\dir\subdir\Test\TestComponent.cshtml) Generated Location: (1776:40,0 [11] ) |UpdateValue| +Source Location: (70:0,70 [5] x:\dir\subdir\Test\TestComponent.cshtml) +|Value| +Generated Location: (2017:49,0 [5] ) +|Value| + Source Location: (105:1,7 [147] x:\dir\subdir\Test\TestComponent.cshtml) | public CustomValue ParentValue { get; set; } = new CustomValue(); public void UpdateValue(CustomValue value) => ParentValue = value; | -Generated Location: (2041:51,0 [147] ) +Generated Location: (2260:60,0 [147] ) | public CustomValue ParentValue { get; set; } = new CustomValue(); diff --git a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/BindToGenericComponent_ExplicitType_WithGetSet_EventCallback/TestComponent.codegen.cs b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/BindToGenericComponent_ExplicitType_WithGetSet_EventCallback/TestComponent.codegen.cs index 1083ea60026..0931ae80c2d 100644 --- a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/BindToGenericComponent_ExplicitType_WithGetSet_EventCallback/TestComponent.codegen.cs +++ b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/BindToGenericComponent_ExplicitType_WithGetSet_EventCallback/TestComponent.codegen.cs @@ -44,6 +44,15 @@ protected override void BuildRenderTree(global::Microsoft.AspNetCore.Components. #line hidden #nullable disable , ParentValue)))); + _ = nameof(global::Test.MyComponent. +#nullable restore +#line (1,71)-(1,76) "x:\dir\subdir\Test\TestComponent.cshtml" +Value + +#line default +#line hidden +#nullable disable + ); __builder.CloseComponent(); } #pragma warning restore 1998 diff --git a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/BindToGenericComponent_ExplicitType_WithGetSet_EventCallback/TestComponent.mappings.txt b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/BindToGenericComponent_ExplicitType_WithGetSet_EventCallback/TestComponent.mappings.txt index 681432f05f9..186d1c12c0e 100644 --- a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/BindToGenericComponent_ExplicitType_WithGetSet_EventCallback/TestComponent.mappings.txt +++ b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/BindToGenericComponent_ExplicitType_WithGetSet_EventCallback/TestComponent.mappings.txt @@ -13,12 +13,17 @@ Source Location: (81:0,81 [11] x:\dir\subdir\Test\TestComponent.cshtml) Generated Location: (1776:40,0 [11] ) |UpdateValue| +Source Location: (70:0,70 [5] x:\dir\subdir\Test\TestComponent.cshtml) +|Value| +Generated Location: (2017:49,0 [5] ) +|Value| + Source Location: (105:1,7 [138] x:\dir\subdir\Test\TestComponent.cshtml) | public CustomValue ParentValue { get; set; } = new CustomValue(); public EventCallback UpdateValue { get; set; } | -Generated Location: (2041:51,0 [138] ) +Generated Location: (2260:60,0 [138] ) | public CustomValue ParentValue { get; set; } = new CustomValue(); public EventCallback UpdateValue { get; set; } diff --git a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/BindToGenericComponent_ExplicitType_WithGetSet_Function/TestComponent.codegen.cs b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/BindToGenericComponent_ExplicitType_WithGetSet_Function/TestComponent.codegen.cs index 160f3a0c69e..909c4ec4f20 100644 --- a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/BindToGenericComponent_ExplicitType_WithGetSet_Function/TestComponent.codegen.cs +++ b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/BindToGenericComponent_ExplicitType_WithGetSet_Function/TestComponent.codegen.cs @@ -44,6 +44,15 @@ protected override void BuildRenderTree(global::Microsoft.AspNetCore.Components. #line hidden #nullable disable , ParentValue)))); + _ = nameof(global::Test.MyComponent. +#nullable restore +#line (1,71)-(1,76) "x:\dir\subdir\Test\TestComponent.cshtml" +Value + +#line default +#line hidden +#nullable disable + ); __builder.CloseComponent(); } #pragma warning restore 1998 diff --git a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/BindToGenericComponent_ExplicitType_WithGetSet_Function/TestComponent.mappings.txt b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/BindToGenericComponent_ExplicitType_WithGetSet_Function/TestComponent.mappings.txt index eb5779adab1..68db27cb598 100644 --- a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/BindToGenericComponent_ExplicitType_WithGetSet_Function/TestComponent.mappings.txt +++ b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/BindToGenericComponent_ExplicitType_WithGetSet_Function/TestComponent.mappings.txt @@ -13,13 +13,18 @@ Source Location: (81:0,81 [11] x:\dir\subdir\Test\TestComponent.cshtml) Generated Location: (1776:40,0 [11] ) |UpdateValue| +Source Location: (70:0,70 [5] x:\dir\subdir\Test\TestComponent.cshtml) +|Value| +Generated Location: (2017:49,0 [5] ) +|Value| + Source Location: (105:1,7 [179] x:\dir\subdir\Test\TestComponent.cshtml) | public CustomValue ParentValue { get; set; } = new CustomValue(); public Task UpdateValue(CustomValue value) { ParentValue = value; return Task.CompletedTask; } | -Generated Location: (2041:51,0 [179] ) +Generated Location: (2260:60,0 [179] ) | public CustomValue ParentValue { get; set; } = new CustomValue(); diff --git a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/GenericBindToGenericComponent_ExplicitType_WithGetSet_Action/TestComponent.codegen.cs b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/GenericBindToGenericComponent_ExplicitType_WithGetSet_Action/TestComponent.codegen.cs index fc83dac0e5a..abb5b66d00f 100644 --- a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/GenericBindToGenericComponent_ExplicitType_WithGetSet_Action/TestComponent.codegen.cs +++ b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/GenericBindToGenericComponent_ExplicitType_WithGetSet_Action/TestComponent.codegen.cs @@ -52,6 +52,15 @@ protected override void BuildRenderTree(global::Microsoft.AspNetCore.Components. #line hidden #nullable disable , ParentValue)))); + _ = nameof(global::Test.MyComponent. +#nullable restore +#line (2,66)-(2,71) "x:\dir\subdir\Test\TestComponent.cshtml" +Value + +#line default +#line hidden +#nullable disable + ); __builder.CloseComponent(); } #pragma warning restore 1998 diff --git a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/GenericBindToGenericComponent_ExplicitType_WithGetSet_Action/TestComponent.mappings.txt b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/GenericBindToGenericComponent_ExplicitType_WithGetSet_Action/TestComponent.mappings.txt index e871ed53501..8b9cda880f3 100644 --- a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/GenericBindToGenericComponent_ExplicitType_WithGetSet_Action/TestComponent.mappings.txt +++ b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/GenericBindToGenericComponent_ExplicitType_WithGetSet_Action/TestComponent.mappings.txt @@ -18,13 +18,18 @@ Source Location: (95:1,76 [11] x:\dir\subdir\Test\TestComponent.cshtml) Generated Location: (1894:48,0 [11] ) |UpdateValue| +Source Location: (84:1,65 [5] x:\dir\subdir\Test\TestComponent.cshtml) +|Value| +Generated Location: (2130:57,0 [5] ) +|Value| + Source Location: (119:2,7 [128] x:\dir\subdir\Test\TestComponent.cshtml) | public TParam ParentValue { get; set; } = default; public void UpdateValue(TParam value) { ParentValue = value; } | -Generated Location: (2159:59,0 [128] ) +Generated Location: (2373:68,0 [128] ) | public TParam ParentValue { get; set; } = default; diff --git a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/GenericBindToGenericComponent_ExplicitType_WithGetSet_EventCallback/TestComponent.codegen.cs b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/GenericBindToGenericComponent_ExplicitType_WithGetSet_EventCallback/TestComponent.codegen.cs index d80a96ccd8f..449d1877b5d 100644 --- a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/GenericBindToGenericComponent_ExplicitType_WithGetSet_EventCallback/TestComponent.codegen.cs +++ b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/GenericBindToGenericComponent_ExplicitType_WithGetSet_EventCallback/TestComponent.codegen.cs @@ -52,6 +52,15 @@ protected override void BuildRenderTree(global::Microsoft.AspNetCore.Components. #line hidden #nullable disable , ParentValue)))); + _ = nameof(global::Test.MyComponent. +#nullable restore +#line (2,66)-(2,71) "x:\dir\subdir\Test\TestComponent.cshtml" +Value + +#line default +#line hidden +#nullable disable + ); __builder.CloseComponent(); } #pragma warning restore 1998 diff --git a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/GenericBindToGenericComponent_ExplicitType_WithGetSet_EventCallback/TestComponent.mappings.txt b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/GenericBindToGenericComponent_ExplicitType_WithGetSet_EventCallback/TestComponent.mappings.txt index c05929e78f1..2e34a36b758 100644 --- a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/GenericBindToGenericComponent_ExplicitType_WithGetSet_EventCallback/TestComponent.mappings.txt +++ b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/GenericBindToGenericComponent_ExplicitType_WithGetSet_EventCallback/TestComponent.mappings.txt @@ -18,12 +18,17 @@ Source Location: (95:1,76 [11] x:\dir\subdir\Test\TestComponent.cshtml) Generated Location: (1894:48,0 [11] ) |UpdateValue| +Source Location: (84:1,65 [5] x:\dir\subdir\Test\TestComponent.cshtml) +|Value| +Generated Location: (2130:57,0 [5] ) +|Value| + Source Location: (119:2,7 [118] x:\dir\subdir\Test\TestComponent.cshtml) | public TParam ParentValue { get; set; } = default; public EventCallback UpdateValue { get; set; } | -Generated Location: (2159:59,0 [118] ) +Generated Location: (2373:68,0 [118] ) | public TParam ParentValue { get; set; } = default; public EventCallback UpdateValue { get; set; } diff --git a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/GenericBindToGenericComponent_ExplicitType_WithGetSet_Function/TestComponent.codegen.cs b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/GenericBindToGenericComponent_ExplicitType_WithGetSet_Function/TestComponent.codegen.cs index 912ae753437..c9532e2b309 100644 --- a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/GenericBindToGenericComponent_ExplicitType_WithGetSet_Function/TestComponent.codegen.cs +++ b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/GenericBindToGenericComponent_ExplicitType_WithGetSet_Function/TestComponent.codegen.cs @@ -52,6 +52,15 @@ protected override void BuildRenderTree(global::Microsoft.AspNetCore.Components. #line hidden #nullable disable , ParentValue)))); + _ = nameof(global::Test.MyComponent. +#nullable restore +#line (2,66)-(2,71) "x:\dir\subdir\Test\TestComponent.cshtml" +Value + +#line default +#line hidden +#nullable disable + ); __builder.CloseComponent(); } #pragma warning restore 1998 diff --git a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/GenericBindToGenericComponent_ExplicitType_WithGetSet_Function/TestComponent.mappings.txt b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/GenericBindToGenericComponent_ExplicitType_WithGetSet_Function/TestComponent.mappings.txt index e2c545c5688..c92c0392099 100644 --- a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/GenericBindToGenericComponent_ExplicitType_WithGetSet_Function/TestComponent.mappings.txt +++ b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/GenericBindToGenericComponent_ExplicitType_WithGetSet_Function/TestComponent.mappings.txt @@ -18,13 +18,18 @@ Source Location: (95:1,76 [11] x:\dir\subdir\Test\TestComponent.cshtml) Generated Location: (1894:48,0 [11] ) |UpdateValue| +Source Location: (84:1,65 [5] x:\dir\subdir\Test\TestComponent.cshtml) +|Value| +Generated Location: (2130:57,0 [5] ) +|Value| + Source Location: (119:2,7 [155] x:\dir\subdir\Test\TestComponent.cshtml) | public TParam ParentValue { get; set; } = default; public Task UpdateValue(TParam value) { ParentValue = value; return Task.CompletedTask; } | -Generated Location: (2159:59,0 [155] ) +Generated Location: (2373:68,0 [155] ) | public TParam ParentValue { get; set; } = default; diff --git a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/GenericComponentBindToGenericComponent_ExplicitType_WithAfter_Action/TestComponent.codegen.cs b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/GenericComponentBindToGenericComponent_ExplicitType_WithAfter_Action/TestComponent.codegen.cs index 6835ab81603..d25bcf9cfb7 100644 --- a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/GenericComponentBindToGenericComponent_ExplicitType_WithAfter_Action/TestComponent.codegen.cs +++ b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/GenericComponentBindToGenericComponent_ExplicitType_WithAfter_Action/TestComponent.codegen.cs @@ -52,6 +52,15 @@ protected override void BuildRenderTree(global::Microsoft.AspNetCore.Components. #line hidden #nullable disable ); })); + _ = nameof(global::Test.MyComponent. +#nullable restore +#line (2,66)-(2,71) "x:\dir\subdir\Test\TestComponent.cshtml" +Value + +#line default +#line hidden +#nullable disable + ); __builder.CloseComponent(); } #pragma warning restore 1998 diff --git a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/GenericComponentBindToGenericComponent_ExplicitType_WithAfter_Action/TestComponent.mappings.txt b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/GenericComponentBindToGenericComponent_ExplicitType_WithAfter_Action/TestComponent.mappings.txt index 3e969a7663c..44f1a953365 100644 --- a/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/GenericComponentBindToGenericComponent_ExplicitType_WithAfter_Action/TestComponent.mappings.txt +++ b/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/GenericComponentBindToGenericComponent_ExplicitType_WithAfter_Action/TestComponent.mappings.txt @@ -18,13 +18,18 @@ Source Location: (97:1,78 [6] x:\dir\subdir\Test\TestComponent.cshtml) Generated Location: (1727:48,0 [6] ) |Update| +Source Location: (84:1,65 [5] x:\dir\subdir\Test\TestComponent.cshtml) +|Value| +Generated Location: (1947:57,0 [5] ) +|Value| + Source Location: (116:2,7 [79] x:\dir\subdir\Test\TestComponent.cshtml) | public TParam ParentValue { get; set; } public void Update() { } | -Generated Location: (1976:59,0 [79] ) +Generated Location: (2190:68,0 [79] ) | public TParam ParentValue { get; set; } From 48eb73b94629b38be3caa7ccc6c8474d2d603d8c Mon Sep 17 00:00:00 2001 From: Chris Sienkiewicz Date: Thu, 14 Nov 2024 15:31:11 -0800 Subject: [PATCH 3/3] Unskip integration tests --- .../GoToDefinitionTests.cs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/Razor/test/Microsoft.VisualStudio.Razor.IntegrationTests/GoToDefinitionTests.cs b/src/Razor/test/Microsoft.VisualStudio.Razor.IntegrationTests/GoToDefinitionTests.cs index e735c892d97..4fa2dbdf4fc 100644 --- a/src/Razor/test/Microsoft.VisualStudio.Razor.IntegrationTests/GoToDefinitionTests.cs +++ b/src/Razor/test/Microsoft.VisualStudio.Razor.IntegrationTests/GoToDefinitionTests.cs @@ -367,8 +367,8 @@ public string? MyProperty { set { } } [IdeTheory] [InlineData("MyProperty:get")] - [InlineData("MyProperty:set", Skip = "https://github.com/dotnet/razor/issues/10966")] - [InlineData("MyProperty:after", Skip = "https://github.com/dotnet/razor/issues/10966")] + [InlineData("MyProperty:set")] + [InlineData("MyProperty:after")] public async Task GoToDefinition_ComponentAttribute_BindSet(string attribute) { // Create the file