-
Notifications
You must be signed in to change notification settings - Fork 229
Verify C# diagnostics in CodeGenerationIntegrationTest
#10337
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 2 commits
Commits
Show all changes
8 commits
Select commit
Hold shift + click to select a range
e9a24ff
Verify C# diagnostics
jjonescz 246cfba
Update baselines
jjonescz 11b1dad
Improve diagnostics diffing code
jjonescz daec57c
Handle emit diagnostics
jjonescz 25296f7
Load dynamic support runtime assembly
jjonescz 15132fb
Merge branch 'main' into verify-everywhere
jjonescz 037221e
Update baselines
jjonescz b9147cd
Merge branch 'main' into verify-everywhere
jjonescz File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
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
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
34 changes: 31 additions & 3 deletions
34
...es/IntegrationTests/CodeGenerationIntegrationTest/AddTagHelperDirective_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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,14 +1,42 @@ | ||
| Document - | ||
| NamespaceDeclaration - - Microsoft.AspNetCore.Razor.Language.IntegrationTests.TestFiles | ||
| ClassDeclaration - - public - TestFiles_IntegrationTests_CodeGenerationIntegrationTest_AddTagHelperDirective_DesignTime - - | ||
| NamespaceDeclaration - - AspNetCore | ||
| UsingDirective - - TModel = global::System.Object | ||
| UsingDirective - (1:0,1 [20] ) - global::System | ||
| UsingDirective - (24:1,1 [40] ) - global::System.Collections.Generic | ||
| UsingDirective - (67:2,1 [25] ) - global::System.Linq | ||
| UsingDirective - (95:3,1 [36] ) - global::System.Threading.Tasks | ||
| UsingDirective - (134:4,1 [38] ) - global::Microsoft.AspNetCore.Mvc | ||
| UsingDirective - (175:5,1 [48] ) - global::Microsoft.AspNetCore.Mvc.Rendering | ||
| UsingDirective - (226:6,1 [51] ) - global::Microsoft.AspNetCore.Mvc.ViewFeatures | ||
| RazorCompiledItemMetadataAttribute - | ||
| CreateNewOnMetadataUpdateAttribute - | ||
| ClassDeclaration - - public - TestFiles_IntegrationTests_CodeGenerationIntegrationTest_AddTagHelperDirective - global::Microsoft.AspNetCore.Mvc.Razor.RazorPage<dynamic> - | ||
| DesignTimeDirective - | ||
| DirectiveToken - (287:7,8 [62] ) - global::Microsoft.AspNetCore.Mvc.Rendering.IHtmlHelper<TModel> | ||
| DirectiveToken - (350:7,71 [4] ) - Html | ||
| DirectiveToken - (364:8,8 [54] ) - global::Microsoft.AspNetCore.Mvc.Rendering.IJsonHelper | ||
| DirectiveToken - (419:8,63 [4] ) - Json | ||
| DirectiveToken - (433:9,8 [53] ) - global::Microsoft.AspNetCore.Mvc.IViewComponentHelper | ||
| DirectiveToken - (487:9,62 [9] ) - Component | ||
| DirectiveToken - (506:10,8 [43] ) - global::Microsoft.AspNetCore.Mvc.IUrlHelper | ||
| DirectiveToken - (550:10,52 [3] ) - Url | ||
| DirectiveToken - (563:11,8 [70] ) - global::Microsoft.AspNetCore.Mvc.ViewFeatures.IModelExpressionProvider | ||
| DirectiveToken - (634:11,79 [23] ) - ModelExpressionProvider | ||
| DirectiveToken - (673:12,14 [104] ) - global::Microsoft.AspNetCore.Mvc.Razor.TagHelpers.UrlResolutionTagHelper, Microsoft.AspNetCore.Mvc.Razor | ||
| DirectiveToken - (793:13,14 [95] ) - global::Microsoft.AspNetCore.Mvc.Razor.TagHelpers.HeadTagHelper, Microsoft.AspNetCore.Mvc.Razor | ||
| DirectiveToken - (904:14,14 [95] ) - global::Microsoft.AspNetCore.Mvc.Razor.TagHelpers.BodyTagHelper, Microsoft.AspNetCore.Mvc.Razor | ||
| DirectiveToken - (14:0,14 [17] AddTagHelperDirective.cshtml) - "*, TestAssembly" | ||
| CSharpCode - | ||
| IntermediateToken - - CSharp - #pragma warning disable 0414 | ||
| CSharpCode - | ||
| IntermediateToken - - CSharp - private static object __o = null; | ||
| CSharpCode - | ||
| IntermediateToken - - CSharp - #pragma warning restore 0414 | ||
| MethodDeclaration - - public async - System.Threading.Tasks.Task - ExecuteAsync | ||
| MethodDeclaration - - public async override - global::System.Threading.Tasks.Task - ExecuteAsync | ||
| HtmlContent - (31:0,31 [2] AddTagHelperDirective.cshtml) | ||
| LazyIntermediateToken - (31:0,31 [2] AddTagHelperDirective.cshtml) - Html - \n | ||
| Inject - | ||
| Inject - | ||
| Inject - | ||
| Inject - | ||
| Inject - |
2 changes: 1 addition & 1 deletion
2
...egrationTests/CodeGenerationIntegrationTest/AddTagHelperDirective_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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,5 +1,5 @@ | ||
| Source Location: (14:0,14 [17] TestFiles/IntegrationTests/CodeGenerationIntegrationTest/AddTagHelperDirective.cshtml) | ||
| |"*, TestAssembly"| | ||
| Generated Location: (551:12,37 [17] ) | ||
| Generated Location: (1253:26,37 [17] ) | ||
| |"*, TestAssembly"| | ||
|
|
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.
Did you consider making these optional params to the
IntegrationTestFact? So we could have e.g.[IntegrationTestFact(SkipVerifyingCSharpDiagnostics = true)]Uh 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.
Hm, haven't considered that, sounds interesting. But it looks like it would be much more difficult to propagate these options down to the IntegrationTestBase methods where I need them. If I understand correctly, I would need to add new properties to IntegrationTestFact, then add new parameters to constructors of each test class, then pass the properties as constructor arguments in IntegrationTestCase. Maybe there's a simpler way? But still, for end-user the effect would be just moving something like
SkipVerifyingCSharpDiagnostics = ExecutionConditionUtil.IsDesktop;from the test body into the attribute which doesn't seem worth the effort here. So I think I will leave as is. But happy to change this in a follow up if I misunderstood :)