-
Notifications
You must be signed in to change notification settings - Fork 199
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Emit and map empty csharp tokens #10969
Merged
Merged
Changes from all commits
Commits
Show all changes
3 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
57 changes: 57 additions & 0 deletions
57
...omponentDesignTimeCodeGenerationTest/InvalidCode_EmptyTransition/TestComponent.codegen.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,57 @@ | ||
// <auto-generated/> | ||
#pragma warning disable 1591 | ||
namespace Test | ||
{ | ||
#line default | ||
using global::System; | ||
using global::System.Collections.Generic; | ||
using global::System.Linq; | ||
using global::System.Threading.Tasks; | ||
using global::Microsoft.AspNetCore.Components; | ||
#line default | ||
#line hidden | ||
#nullable restore | ||
public partial class TestComponent : global::Microsoft.AspNetCore.Components.ComponentBase | ||
#nullable disable | ||
{ | ||
#pragma warning disable 219 | ||
private void __RazorDirectiveTokenHelpers__() { | ||
} | ||
#pragma warning restore 219 | ||
#pragma warning disable 0414 | ||
private static object __o = null; | ||
#pragma warning restore 0414 | ||
#pragma warning disable 1998 | ||
protected override void BuildRenderTree(global::Microsoft.AspNetCore.Components.Rendering.RenderTreeBuilder __builder) | ||
{ | ||
__o = ""; | ||
__builder.AddAttribute(-1, "ChildContent", (global::Microsoft.AspNetCore.Components.RenderFragment)((__builder2) => { | ||
} | ||
)); | ||
#nullable restore | ||
#line 1 "x:\dir\subdir\Test\TestComponent.cshtml" | ||
__o = typeof(global::Test.TestComponent); | ||
|
||
#line default | ||
#line hidden | ||
#nullable disable | ||
#nullable restore | ||
#line 3 "x:\dir\subdir\Test\TestComponent.cshtml" | ||
__o = ; | ||
|
||
#line default | ||
#line hidden | ||
#nullable disable | ||
} | ||
#pragma warning restore 1998 | ||
#nullable restore | ||
#line 5 "x:\dir\subdir\Test\TestComponent.cshtml" | ||
|
||
[Parameter] public int Param { get; set; } | ||
|
||
#line default | ||
#line hidden | ||
#nullable disable | ||
} | ||
} | ||
#pragma warning restore 1591 |
1 change: 1 addition & 0 deletions
1
...entDesignTimeCodeGenerationTest/InvalidCode_EmptyTransition/TestComponent.diagnostics.txt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
x:\dir\subdir\Test\TestComponent.cshtml(3,2): Error RZ1003: A space or line break was encountered after the "@" character. Only valid identifiers, keywords, comments, "(" and "{" are valid at the start of a code block and they must occur immediately following "@" with no space in between. |
28 changes: 28 additions & 0 deletions
28
...ts/ComponentDesignTimeCodeGenerationTest/InvalidCode_EmptyTransition/TestComponent.ir.txt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
Document - | ||
NamespaceDeclaration - - Test | ||
UsingDirective - (3:1,1 [20] ) - global::System | ||
UsingDirective - (26:2,1 [40] ) - global::System.Collections.Generic | ||
UsingDirective - (69:3,1 [25] ) - global::System.Linq | ||
UsingDirective - (97:4,1 [36] ) - global::System.Threading.Tasks | ||
UsingDirective - (136:5,1 [45] ) - global::Microsoft.AspNetCore.Components | ||
ClassDeclaration - - public partial - TestComponent - global::Microsoft.AspNetCore.Components.ComponentBase - | ||
DesignTimeDirective - | ||
CSharpCode - | ||
IntermediateToken - - CSharp - #pragma warning disable 0414 | ||
CSharpCode - | ||
IntermediateToken - - CSharp - private static object __o = null; | ||
CSharpCode - | ||
IntermediateToken - - CSharp - #pragma warning restore 0414 | ||
MethodDeclaration - - protected override - void - BuildRenderTree | ||
Component - (0:0,0 [31] x:\dir\subdir\Test\TestComponent.cshtml) - TestComponent | ||
ComponentAttribute - - Value - - AttributeStructure.DoubleQuotes | ||
HtmlContent - (22:0,22 [5] x:\dir\subdir\Test\TestComponent.cshtml) | ||
LazyIntermediateToken - (22:0,22 [5] x:\dir\subdir\Test\TestComponent.cshtml) - Html - Hello | ||
HtmlContent - (31:0,31 [4] x:\dir\subdir\Test\TestComponent.cshtml) | ||
LazyIntermediateToken - (31:0,31 [4] x:\dir\subdir\Test\TestComponent.cshtml) - Html - \n\n | ||
CSharpExpression - (36:2,1 [0] x:\dir\subdir\Test\TestComponent.cshtml) | ||
LazyIntermediateToken - (36:2,1 [0] x:\dir\subdir\Test\TestComponent.cshtml) - CSharp - | ||
HtmlContent - (36:2,1 [4] x:\dir\subdir\Test\TestComponent.cshtml) | ||
LazyIntermediateToken - (36:2,1 [4] x:\dir\subdir\Test\TestComponent.cshtml) - Html - \n\n | ||
CSharpCode - (47:4,7 [50] x:\dir\subdir\Test\TestComponent.cshtml) | ||
LazyIntermediateToken - (47:4,7 [50] x:\dir\subdir\Test\TestComponent.cshtml) - CSharp - \n [Parameter] public int Param { get; set; }\n |
14 changes: 14 additions & 0 deletions
14
...ponentDesignTimeCodeGenerationTest/InvalidCode_EmptyTransition/TestComponent.mappings.txt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
Source Location: (36:2,1 [0] x:\dir\subdir\Test\TestComponent.cshtml) | ||
|| | ||
Generated Location: (1340:39,6 [0] ) | ||
|| | ||
|
||
Source Location: (47:4,7 [50] x:\dir\subdir\Test\TestComponent.cshtml) | ||
| | ||
[Parameter] public int Param { get; set; } | ||
| | ||
Generated Location: (1519:48,7 [50] ) | ||
| | ||
[Parameter] public int Param { get; set; } | ||
| | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
45 changes: 45 additions & 0 deletions
45
...s/ComponentRuntimeCodeGenerationTest/InvalidCode_EmptyTransition/TestComponent.codegen.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,45 @@ | ||
// <auto-generated/> | ||
#pragma warning disable 1591 | ||
namespace Test | ||
{ | ||
#line default | ||
using global::System; | ||
using global::System.Collections.Generic; | ||
using global::System.Linq; | ||
using global::System.Threading.Tasks; | ||
using global::Microsoft.AspNetCore.Components; | ||
#line default | ||
#line hidden | ||
#nullable restore | ||
public partial class TestComponent : global::Microsoft.AspNetCore.Components.ComponentBase | ||
#nullable disable | ||
{ | ||
#pragma warning disable 1998 | ||
protected override void BuildRenderTree(global::Microsoft.AspNetCore.Components.Rendering.RenderTreeBuilder __builder) | ||
{ | ||
__builder.OpenComponent<global::Test.TestComponent>(0); | ||
__builder.AddComponentParameter(1, "Value", "Hello"); | ||
__builder.CloseComponent(); | ||
__builder.AddMarkupContent(2, "\r\n\r\n"); | ||
__builder.AddContent(3, | ||
#nullable restore | ||
#line (3,2)-(3,2) "x:\dir\subdir\Test\TestComponent.cshtml" | ||
|
||
#line default | ||
#line hidden | ||
#nullable disable | ||
); | ||
} | ||
#pragma warning restore 1998 | ||
#nullable restore | ||
#line (5,8)-(7,1) "x:\dir\subdir\Test\TestComponent.cshtml" | ||
|
||
[Parameter] public int Param { get; set; } | ||
|
||
#line default | ||
#line hidden | ||
#nullable disable | ||
|
||
} | ||
} | ||
#pragma warning restore 1591 |
1 change: 1 addition & 0 deletions
1
...ponentRuntimeCodeGenerationTest/InvalidCode_EmptyTransition/TestComponent.diagnostics.txt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
x:\dir\subdir\Test\TestComponent.cshtml(3,2): Error RZ1003: A space or line break was encountered after the "@" character. Only valid identifiers, keywords, comments, "(" and "{" are valid at the start of a code block and they must occur immediately following "@" with no space in between. |
19 changes: 19 additions & 0 deletions
19
...Tests/ComponentRuntimeCodeGenerationTest/InvalidCode_EmptyTransition/TestComponent.ir.txt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
Document - | ||
NamespaceDeclaration - - Test | ||
UsingDirective - (3:1,1 [20] ) - global::System | ||
UsingDirective - (26:2,1 [40] ) - global::System.Collections.Generic | ||
UsingDirective - (69:3,1 [25] ) - global::System.Linq | ||
UsingDirective - (97:4,1 [36] ) - global::System.Threading.Tasks | ||
UsingDirective - (136:5,1 [45] ) - global::Microsoft.AspNetCore.Components | ||
ClassDeclaration - - public partial - TestComponent - global::Microsoft.AspNetCore.Components.ComponentBase - | ||
MethodDeclaration - - protected override - void - BuildRenderTree | ||
Component - (0:0,0 [31] x:\dir\subdir\Test\TestComponent.cshtml) - TestComponent | ||
ComponentAttribute - - Value - - AttributeStructure.DoubleQuotes | ||
HtmlContent - (22:0,22 [5] x:\dir\subdir\Test\TestComponent.cshtml) | ||
LazyIntermediateToken - (22:0,22 [5] x:\dir\subdir\Test\TestComponent.cshtml) - Html - Hello | ||
HtmlContent - (31:0,31 [4] x:\dir\subdir\Test\TestComponent.cshtml) | ||
LazyIntermediateToken - (31:0,31 [4] x:\dir\subdir\Test\TestComponent.cshtml) - Html - \n\n | ||
CSharpExpression - (36:2,1 [0] x:\dir\subdir\Test\TestComponent.cshtml) | ||
LazyIntermediateToken - (36:2,1 [0] x:\dir\subdir\Test\TestComponent.cshtml) - CSharp - | ||
CSharpCode - (47:4,7 [50] x:\dir\subdir\Test\TestComponent.cshtml) | ||
LazyIntermediateToken - (47:4,7 [50] x:\dir\subdir\Test\TestComponent.cshtml) - CSharp - \n [Parameter] public int Param { get; set; }\n |
14 changes: 14 additions & 0 deletions
14
...ComponentRuntimeCodeGenerationTest/InvalidCode_EmptyTransition/TestComponent.mappings.txt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
Source Location: (36:2,1 [0] x:\dir\subdir\Test\TestComponent.cshtml) | ||
|| | ||
Generated Location: (1005:26,0 [0] ) | ||
|| | ||
|
||
Source Location: (47:4,7 [50] x:\dir\subdir\Test\TestComponent.cshtml) | ||
| | ||
[Parameter] public int Param { get; set; } | ||
| | ||
Generated Location: (1200:35,0 [50] ) | ||
| | ||
[Parameter] public int Param { get; set; } | ||
| | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Integration tests don't run automatically on PRs, right? Should we enqueue a run manually to verify this test?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ran integration tests on this PR and everything looks good.