-
Notifications
You must be signed in to change notification settings - Fork 229
Add global:: to default usings
#8314
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
Closed
Closed
Changes from 1 commit
Commits
Show all changes
8 commits
Select commit
Hold shift + click to select a range
0d1faff
Add a test
jjonescz af335c3
Add `global::` to default `using`s
jjonescz 4f09abc
Fix more `global::`-unprefixed type names
jjonescz 7e90f94
Add baselines
jjonescz 386a4d6
Deduplicate `global::` default usings against user usings
jjonescz 68c475c
Handle `using global::` when discovering tag helpers
jjonescz d22826a
Update baselines
jjonescz 7dc27bf
Fix project directory name hint
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
37 changes: 37 additions & 0 deletions
37
...meCodeGenerationTest/Component_NamespaceDirective_ContainsSystem/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,37 @@ | ||
| // <auto-generated/> | ||
| #pragma warning disable 1591 | ||
| namespace X.System.Y | ||
| { | ||
| #line hidden | ||
| using global::System; | ||
| using global::System.Collections.Generic; | ||
| using global::System.Linq; | ||
| using global::System.Threading.Tasks; | ||
| using global::Microsoft.AspNetCore.Components; | ||
| public partial class TestComponent : global::Microsoft.AspNetCore.Components.ComponentBase | ||
| { | ||
| #pragma warning disable 219 | ||
| private void __RazorDirectiveTokenHelpers__() { | ||
| ((global::System.Action)(() => { | ||
| #nullable restore | ||
| #line 1 "x:\dir\subdir\Test\TestComponent.cshtml" | ||
| global::System.Object __typeHelper = nameof(X.System.Y); | ||
|
|
||
| #line default | ||
| #line hidden | ||
| #nullable disable | ||
| } | ||
| ))(); | ||
| } | ||
| #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) | ||
| { | ||
| } | ||
| #pragma warning restore 1998 | ||
| } | ||
| } | ||
| #pragma warning restore 1591 | ||
17 changes: 17 additions & 0 deletions
17
...gnTimeCodeGenerationTest/Component_NamespaceDirective_ContainsSystem/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,17 @@ | ||
| Document - | ||
| NamespaceDeclaration - - X.System.Y | ||
| 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 - | ||
| DirectiveToken - (11:0,11 [10] x:\dir\subdir\Test\TestComponent.cshtml) - X.System.Y | ||
| 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 |
5 changes: 5 additions & 0 deletions
5
...CodeGenerationTest/Component_NamespaceDirective_ContainsSystem/TestComponent.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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,5 @@ | ||
| Source Location: (11:0,11 [10] x:\dir\subdir\Test\TestComponent.cshtml) | ||
| |X.System.Y| | ||
| Generated Location: (649:17,44 [10] ) | ||
| |X.System.Y| | ||
|
|
20 changes: 20 additions & 0 deletions
20
...meCodeGenerationTest/Component_NamespaceDirective_ContainsSystem/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,20 @@ | ||
| // <auto-generated/> | ||
| #pragma warning disable 1591 | ||
| namespace X.System.Y | ||
| { | ||
| #line hidden | ||
| using global::System; | ||
| using global::System.Collections.Generic; | ||
| using global::System.Linq; | ||
| using global::System.Threading.Tasks; | ||
| using global::Microsoft.AspNetCore.Components; | ||
| public partial class TestComponent : global::Microsoft.AspNetCore.Components.ComponentBase | ||
| { | ||
| #pragma warning disable 1998 | ||
| protected override void BuildRenderTree(global::Microsoft.AspNetCore.Components.Rendering.RenderTreeBuilder __builder) | ||
| { | ||
| } | ||
| #pragma warning restore 1998 | ||
| } | ||
| } | ||
| #pragma warning restore 1591 |
9 changes: 9 additions & 0 deletions
9
...untimeCodeGenerationTest/Component_NamespaceDirective_ContainsSystem/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,9 @@ | ||
| Document - | ||
| NamespaceDeclaration - - X.System.Y | ||
| 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 |
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.
📝 I'm expecting this to be just
objectby the end of this changeUh oh!
There was an error while loading. Please reload this page.
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.
I don't plan to update everything to
object(that's orthogonal to the issue), I just fixed cases where there wasSystem.Objectwithoutglobal::, failing the new test cases. I could perhaps useglobal::System.Objecteverywhere butobjectseemed better.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.
objectis definitely better.