Skip to content

Remove LazyContent.Create identity wrappers in resolution phase#13004

Merged
chsienki merged 6 commits intomainfrom
copilot/remove-lazycontent-create-wrappers
Apr 14, 2026
Merged

Remove LazyContent.Create identity wrappers in resolution phase#13004
chsienki merged 6 commits intomainfrom
copilot/remove-lazycontent-create-wrappers

Conversation

Copy link
Copy Markdown

Copilot AI commented Apr 3, 2026

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 with LazyContent print as LazyIntermediateToken instead of IntermediateToken). This PR removes them as proper cleanup.

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
Copilot AI requested a review from chsienki April 3, 2026 01:30
@chsienki chsienki marked this pull request as ready for review April 8, 2026 20:30
@chsienki chsienki requested a review from a team as a code owner April 8, 2026 20:30
@chsienki chsienki marked this pull request as draft April 8, 2026 20:31
Agent-Logs-Url: https://github.com/dotnet/razor/sessions/de963b3a-7679-4178-839e-3e7c37e9c0cb

Co-authored-by: chsienki <16246502+chsienki@users.noreply.github.com>
Copilot AI requested a review from chsienki April 8, 2026 20:38
contentLocation.Character + contentLength);
expr.Children.Add(new CSharpIntermediateToken(
LazyContent.Create(text, static s => s), contentSpan));
expr.Children.Add(new CSharpIntermediateToken(text, contentSpan));
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

expr.Children.Add(new CSharpIntermediateToken(text, contentSpan));

Are there some more usages that can be changed in DefaultTagHelperResolutionPhase.cs?

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Good catch, removing those too.

Copy link
Copy Markdown

@ToddGrun ToddGrun left a comment

Choose a reason for hiding this comment

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

:shipit:

…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>
@chsienki chsienki marked this pull request as ready for review April 14, 2026 00:02
…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>
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.

Remove LazyContent.Create identity wrappers in resolution phase

5 participants