Remove LazyContent.Create identity wrappers in resolution phase#13004
Merged
Remove LazyContent.Create identity wrappers in resolution phase#13004
Conversation
Agent-Logs-Url: https://github.com/dotnet/razor/sessions/3a898a8c-7bb9-467f-88cd-7abd84ee6e59 Co-authored-by: chsienki <16246502+chsienki@users.noreply.github.com>
Copilot
AI
changed the title
[WIP] Remove LazyContent.Create identity wrappers in resolution phase
Remove LazyContent.Create identity wrappers in resolution phase
Apr 3, 2026
Agent-Logs-Url: https://github.com/dotnet/razor/sessions/96e730f5-9b87-4548-a855-bc1176de6263 Co-authored-by: chsienki <16246502+chsienki@users.noreply.github.com>
chsienki
reviewed
Apr 8, 2026
Agent-Logs-Url: https://github.com/dotnet/razor/sessions/de963b3a-7679-4178-839e-3e7c37e9c0cb Co-authored-by: chsienki <16246502+chsienki@users.noreply.github.com>
davidwengier
approved these changes
Apr 9, 2026
ToddGrun
reviewed
Apr 9, 2026
| contentLocation.Character + contentLength); | ||
| expr.Children.Add(new CSharpIntermediateToken( | ||
| LazyContent.Create(text, static s => s), contentSpan)); | ||
| expr.Children.Add(new CSharpIntermediateToken(text, contentSpan)); |
Member
There was a problem hiding this comment.
Good catch, removing those too.
…DefaultTagHelperResolutionPhase Agent-Logs-Url: https://github.com/dotnet/razor/sessions/abb2d099-2d0b-4ba3-8f11-05a4d0de0fe6 Co-authored-by: chsienki <16246502+chsienki@users.noreply.github.com>
…mediateNodeFactory Agent-Logs-Url: https://github.com/dotnet/razor/sessions/64165b02-c750-45ec-b94f-bcfa00687bfc Co-authored-by: chsienki <16246502+chsienki@users.noreply.github.com>
This was referenced Apr 14, 2026
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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
PR #12957 (deferred tag helper lowering) introduced
LazyContent.Create(x, static s => s)identity wrappers in the resolution phase — these capture an already-materialized string and return it unchanged, providing zero behavioral benefit. They were kept solely to avoid changing the IR baseline test output at the time (nodes withLazyContentprint asLazyIntermediateTokeninstead ofIntermediateToken). This PR removes them as proper cleanup.