-
Notifications
You must be signed in to change notification settings - Fork 229
Allow components in global namespace #10086
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
Merged
Merged
Changes from all commits
Commits
Show all changes
14 commits
Select commit
Hold shift + click to select a range
8a05492
Allow components in global namespace
jjonescz 9de3c17
Update existing tests
jjonescz b225060
Merge branch 'main' into 1954771-EmptyNamespace
jjonescz acf1208
Fixup baseline
jjonescz a7713a7
Test formatting of component in global namespace
jjonescz e9f30fb
Add design-time codegen test
jjonescz 61ead07
Automatically determine where empty root namespace is allowed
jjonescz d5eeae8
Fixup tooling
jjonescz 7f6c75d
Test more formatting in global namespace
jjonescz cfb9176
Fix global namespace testing
jjonescz ae4fc31
Fix formatting in global namespace
jjonescz 8586250
Check global namespace flag instead of empty string
jjonescz 1836b11
Merge branch 'main' into 1954771-EmptyNamespace
jjonescz 0d0bf2b
Merge branch 'main' into 1954771-EmptyNamespace
jjonescz 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 hidden or 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
4 changes: 2 additions & 2 deletions
4
...TestFiles/IntegrationTests/CodeGenerationIntegrationTest/BasicComponent_DesignTime.ir.txt
This file contains hidden or 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
8 changes: 4 additions & 4 deletions
8
...les/IntegrationTests/CodeGenerationIntegrationTest/BasicComponent_DesignTime.mappings.txt
This file contains hidden or 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 hidden or 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
4 changes: 2 additions & 2 deletions
4
...st/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/BasicComponent_Runtime.ir.txt
This file contains hidden or 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 hidden or 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 hidden or 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
50 changes: 50 additions & 0 deletions
50
...onTests/ComponentDesignTimeCodeGenerationTest/EmptyRootNamespace/TestComponent.codegen.cs
This file contains hidden or 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,50 @@ | ||
| // <auto-generated/> | ||
| #pragma warning disable 1591 | ||
|
|
||
| #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) | ||
| { | ||
| __builder.AddAttribute(-1, "ChildContent", (global::Microsoft.AspNetCore.Components.RenderFragment)((__builder2) => { | ||
| } | ||
| )); | ||
| #nullable restore | ||
| #line 2 "x:\dir\subdir\Test\TestComponent.cshtml" | ||
| __o = typeof(global::Component1); | ||
|
|
||
| #line default | ||
| #line hidden | ||
| #nullable disable | ||
| __builder.AddAttribute(-1, "ChildContent", (global::Microsoft.AspNetCore.Components.RenderFragment)((__builder2) => { | ||
| } | ||
| )); | ||
| #nullable restore | ||
| #line 3 "x:\dir\subdir\Test\TestComponent.cshtml" | ||
| __o = typeof(global::Shared.Component2); | ||
|
|
||
| #line default | ||
| #line hidden | ||
| #nullable disable | ||
| } | ||
| #pragma warning restore 1998 | ||
| } | ||
|
|
||
| #pragma warning restore 1591 |
25 changes: 25 additions & 0 deletions
25
...rationTests/ComponentDesignTimeCodeGenerationTest/EmptyRootNamespace/TestComponent.ir.txt
This file contains hidden or 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,25 @@ | ||
| Document - | ||
| NamespaceDeclaration - - | ||
| 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 | ||
| MarkupElement - (0:0,0 [18] x:\dir\subdir\Test\TestComponent.cshtml) - h1 | ||
| HtmlContent - (4:0,4 [9] x:\dir\subdir\Test\TestComponent.cshtml) | ||
| LazyIntermediateToken - (4:0,4 [9] x:\dir\subdir\Test\TestComponent.cshtml) - Html - Generated | ||
| HtmlContent - (18:0,18 [2] x:\dir\subdir\Test\TestComponent.cshtml) | ||
| LazyIntermediateToken - (18:0,18 [2] x:\dir\subdir\Test\TestComponent.cshtml) - Html - \n | ||
| Component - (20:1,0 [14] x:\dir\subdir\Test\TestComponent.cshtml) - Component1 | ||
| HtmlContent - (34:1,14 [2] x:\dir\subdir\Test\TestComponent.cshtml) | ||
| LazyIntermediateToken - (34:1,14 [2] x:\dir\subdir\Test\TestComponent.cshtml) - Html - \n | ||
| Component - (36:2,0 [21] x:\dir\subdir\Test\TestComponent.cshtml) - Shared.Component2 |
29 changes: 29 additions & 0 deletions
29
...ationTests/ComponentRuntimeCodeGenerationTest/EmptyRootNamespace/TestComponent.codegen.cs
This file contains hidden or 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,29 @@ | ||
| // <auto-generated/> | ||
| #pragma warning disable 1591 | ||
|
|
||
| #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.AddMarkupContent(0, "<h1>Generated</h1>\r\n"); | ||
| __builder.OpenComponent<global::Component1>(1); | ||
| __builder.CloseComponent(); | ||
| __builder.AddMarkupContent(2, "\r\n"); | ||
| __builder.OpenComponent<global::Shared.Component2>(3); | ||
| __builder.CloseComponent(); | ||
| } | ||
| #pragma warning restore 1998 | ||
| } | ||
|
|
||
| #pragma warning restore 1591 |
14 changes: 14 additions & 0 deletions
14
...tegrationTests/ComponentRuntimeCodeGenerationTest/EmptyRootNamespace/TestComponent.ir.txt
This file contains hidden or 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 @@ | ||
| Document - | ||
| NamespaceDeclaration - - | ||
| UsingDirective - (3:1,1 [22] ) - global::System | ||
| UsingDirective - (26:2,1 [42] ) - global::System.Collections.Generic | ||
| UsingDirective - (69:3,1 [27] ) - global::System.Linq | ||
| UsingDirective - (97:4,1 [38] ) - global::System.Threading.Tasks | ||
| UsingDirective - (136:5,1 [47] ) - global::Microsoft.AspNetCore.Components | ||
| ClassDeclaration - - public partial - TestComponent - global::Microsoft.AspNetCore.Components.ComponentBase - | ||
| MethodDeclaration - - protected override - void - BuildRenderTree | ||
| MarkupBlock - - <h1>Generated</h1>\n | ||
| Component - (20:1,0 [14] x:\dir\subdir\Test\TestComponent.cshtml) - Component1 | ||
| HtmlContent - (34:1,14 [2] x:\dir\subdir\Test\TestComponent.cshtml) | ||
| LazyIntermediateToken - (34:1,14 [2] x:\dir\subdir\Test\TestComponent.cshtml) - Html - \n | ||
| Component - (36:2,0 [21] x:\dir\subdir\Test\TestComponent.cshtml) - Shared.Component2 |
This file contains hidden or 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 hidden or 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 hidden or 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 hidden or 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
Oops, something went wrong.
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.
_type.ContainingNamespace.ToDisplayString()would be"<global namespace>"; withSymbolExtensions.FullNameTypeDisplayFormatwe get an empty string instead (this format was already used in other places, just not everywhere)