Skip to content

Make IntermediateNodeCollection implement IReadOnlyList<IntermediateNode>#13006

Merged
chsienki merged 2 commits into
mainfrom
copilot/make-intermediate-node-collection-implement-ireado
Apr 3, 2026
Merged

Make IntermediateNodeCollection implement IReadOnlyList<IntermediateNode>#13006
chsienki merged 2 commits into
mainfrom
copilot/make-intermediate-node-collection-implement-ireado

Conversation

Copilot AI commented Apr 3, 2026

Copy link
Copy Markdown

Summary of the changes

  • IntermediateNodeCollection already had Count and an indexed getter but didn't declare IReadOnlyList<IntermediateNode>, blocking standard LINQ and list-pattern usage on Children collections.

  • Added IReadOnlyList<IntermediateNode> to the interface list — no new members needed, purely additive.

Enables patterns like:

// Previously required custom helpers
node.Children.All(c => c is HtmlIntermediateToken)

// Or list patterns
if (node.Children is [HtmlIntermediateToken])

Warning

Firewall rules blocked me from connecting to one or more addresses (expand for details)

I tried to connect to the following addresses, but was blocked by firewall rules:

  • st8vsblobprodcus339.vsblob.vsassets.io
    • Triggering command: /usr/share/dotnet/dotnet dotnet build src/Compiler/Microsoft.CodeAnalysis.Razor.Compiler/src/Microsoft.CodeAnalysis.Razor.Compiler.csproj (dns block)

If you need me to access, download, or install something from one of these locations, you can either:

…ode>

Agent-Logs-Url: https://github.com/dotnet/razor/sessions/a3fc45dd-ff43-4532-bcec-d9f06d1db966

Co-authored-by: chsienki <16246502+chsienki@users.noreply.github.com>
Copilot AI changed the title [WIP] Implement IReadOnlyList<IntermediateNode> in IntermediateNodeCollection Make IntermediateNodeCollection implement IReadOnlyList<IntermediateNode> Apr 3, 2026
Copilot AI requested a review from chsienki April 3, 2026 01:13
@chsienki
chsienki marked this pull request as ready for review April 3, 2026 01:17
@chsienki
chsienki requested a review from a team as a code owner April 3, 2026 01:17
namespace Microsoft.AspNetCore.Razor.Language.Intermediate;

public sealed class IntermediateNodeCollection : IList<IntermediateNode>
public sealed class IntermediateNodeCollection : IList<IntermediateNode>, IReadOnlyList<IntermediateNode>

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Are there some places we can change to take advantage of this, or is that coming later?

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.

Yeah there are places. It'll be a follow up just because of the way I broke up the github issues.

@chsienki
chsienki enabled auto-merge (squash) April 3, 2026 01:24
@chsienki
chsienki merged commit d496432 into main Apr 3, 2026
10 checks passed
@chsienki
chsienki deleted the copilot/make-intermediate-node-collection-implement-ireado branch April 3, 2026 01:53
@dotnet-policy-service dotnet-policy-service Bot added this to the Next milestone Apr 3, 2026
@JoeRobich JoeRobich modified the milestones: Next, 18.7 Apr 28, 2026
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.

Make IntermediateNodeCollection implement IReadOnlyList<IntermediateNode>

4 participants