Skip to content

Conversation

@333fred
Copy link
Member

@333fred 333fred commented May 1, 2024

Because of how we were rewriting tag helper attribute values, we didn't output a single, unified token when moving an implicit C# transition back to standard C#. This meant that, when we emit #line directives, we considered the @ and the identifier that followed it to be separate tokens; when we added more precise info for FUSE, this then meant that they were emitted on separate lines during runtime codegen and everything fell apart. To fix this, we now unify those implicit transition tokens, rather than trying to keep them as separate tokens. Fixes #10186, for real this time.

Comment on lines -496 to -504
#line (26,25)-(26,26) "TestFiles/IntegrationTests/CodeGenerationIntegrationTest/ComplexTagHelpers.cshtml"
@

#line default
#line hidden
#nullable disable
#nullable restore
#line (26,26)-(26,49) "TestFiles/IntegrationTests/CodeGenerationIntegrationTest/ComplexTagHelpers.cshtml"
DateTimeOffset.Now.Year
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If we had been validating C# diagnostics, this would have been caught before FUSE was merged. More priority to #10247.

…ng tag helpers

Because of how we were rewriting tag helper attribute values, we didn't output a single, unified token when moving an implicit C# transition back to standard C#. This meant that, when we emit `#line` directives, we considered the `@` and the identifier that followed it to be separate tokens; when we added more precise info for FUSE, this then meant that they were emitted on separate lines during runtime codegen and everything fell apart. To fix this, we now unify those implicit transition tokens, rather than trying to keep them as separate tokens. Fixes #10186, for real this time.
@333fred 333fred force-pushed the tag-helper-transition-stitching branch from 69ae12c to 6517c6d Compare May 1, 2024 02:18
@333fred 333fred marked this pull request as ready for review May 1, 2024 02:18
@333fred 333fred requested a review from a team as a code owner May 1, 2024 02:18
@333fred
Copy link
Member Author

333fred commented May 1, 2024

@dotnet/razor-compiler for reviews please

Copy link
Member

@DustinCampbell DustinCampbell left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good!

@333fred
Copy link
Member Author

333fred commented May 1, 2024

@dotnet/razor-compiler for a second review

@333fred 333fred merged commit 26ce354 into main May 2, 2024
@333fred 333fred deleted the tag-helper-transition-stitching branch May 2, 2024 16:21
@dotnet-policy-service dotnet-policy-service bot added this to the Next milestone May 2, 2024
333fred added a commit that referenced this pull request May 9, 2024
* upstream/main: (374 commits)
  Don't use CancellationTokenSource for disposal
  Support Linked Editing Ranges in Cohosting. (#10349)
  Localized file check-in by OneLocBuild Task: Build definition ID 262: Build ID 2445915
  Localized file check-in by OneLocBuild Task: Build definition ID 262: Build ID 2445915
  Update 17.11 config after VS snap
  Update dependencies from https://github.com/dotnet/source-build-reference-packages build 20240502.1
  Add test
  Don't think we need this any more
  Remove Base64 helpers now that they aren't used
  Whitespace is not significant, but it is important
  Add ProjectKey APIs for representing unknown projects
  Fix up serialization tests
  RazorProjectInfo.SerializationFilePath -> ProjectKey
  Clean up places were an invalid ProjectKey is used
  Move ProjectKey to MS.ANC.Razor.ProjectEngineHost
  Remove ProjectKey static construction methods
  Protect against exceptions when deleting files
  Localized file check-in by OneLocBuild Task: Build definition ID 262: Build ID 2443298
  Localized file check-in by OneLocBuild Task: Build definition ID 262: Build ID 2443298
  Correctly stitch `@` characters to following identifiers when rewriting tag helpers (#10331)
  ...
333fred added a commit to 333fred/razor that referenced this pull request May 20, 2024
…ng tag helpers (dotnet#10331)

Because of how we were rewriting tag helper attribute values, we didn't output a single, unified token when moving an implicit C# transition back to standard C#. This meant that, when we emit `#line` directives, we considered the `@` and the identifier that followed it to be separate tokens; when we added more precise info for FUSE, this then meant that they were emitted on separate lines during runtime codegen and everything fell apart. To fix this, we now unify those implicit transition tokens, rather than trying to keep them as separate tokens. Fixes dotnet#10186, for real this time.

(cherry picked from commit 26ce354)
333fred added a commit that referenced this pull request May 21, 2024
* Correctly stitch `@` characters to following identifiers when rewriting tag helpers (#10331)

Because of how we were rewriting tag helper attribute values, we didn't output a single, unified token when moving an implicit C# transition back to standard C#. This meant that, when we emit `#line` directives, we considered the `@` and the identifier that followed it to be separate tokens; when we added more precise info for FUSE, this then meant that they were emitted on separate lines during runtime codegen and everything fell apart. To fix this, we now unify those implicit transition tokens, rather than trying to keep them as separate tokens. Fixes #10186, for real this time.

(cherry picked from commit 26ce354)

* Update baseline for 17.10 code.
@Cosifne Cosifne modified the milestones: Next, 17.11 P2 May 28, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[dotnet-sdk-9.0.100-preview.3.24175.24] CS1646 error when building Hawaso

5 participants