Skip to content

Analysis: Rename PartialCallerIndex to RenderGraph and answer both directions - #2190

Merged
marcoroth merged 1 commit into
analysis-dependency-indexfrom
analysis-render-graph
Aug 11, 2026
Merged

Analysis: Rename PartialCallerIndex to RenderGraph and answer both directions#2190
marcoroth merged 1 commit into
analysis-dependency-indexfrom
analysis-render-graph

Conversation

@marcoroth

@marcoroth marcoroth commented Aug 11, 2026

Copy link
Copy Markdown
Owner

This pull request lets a rule ask what a render call hands back, which is what #2100 needs.

Today a rule can ask what encloses a partial. ancestorVerdict walks up from a partial through everything that renders it and answers always, never, mixed or unknown.

But, there was no way to ask the same question downwards, so this reports an offense it should not:

_panel.html.erb:

<details>
  <%= render "shared/summary" %>
  <p>Body</p>
</details>

_summary.html.erb:

<summary>More</summary>

The index already held both ends of every edge. callSites is keyed by callee, and each site records its caller, so the render relationships were all there. Only the queries were direction-specific.

What was missing is a property of the node to answer what a template puts at its own top level. Each template now records its TemplateRoots, the tags at its root, split into unconditional and conditional, along with the renders sitting at root position, resolved to files while the builder still has the partial index in hand.

That is why the class is renamed. PartialCallerIndex described one direction of something that now answers both.

@github-actions github-actions Bot added linter @herb-tools/linter for HTML+ERB templates language-server @herb-tools/language-server and Language Server Protocol support typescript TypeScript source across the javascript/ packages linter-rule Individual linter rules and their documentation analysis labels Aug 11, 2026
@pkg-pr-new

pkg-pr-new Bot commented Aug 11, 2026

Copy link
Copy Markdown
npx https://pkg.pr.new/@herb-tools/formatter@2190
npx https://pkg.pr.new/@herb-tools/language-server@2190
npx https://pkg.pr.new/@herb-tools/linter@2190

commit: 73deedb

@github-actions

github-actions Bot commented Aug 11, 2026

Copy link
Copy Markdown

🌿 Interactive Playground and Documentation Preview

A preview deployment has been built for this pull request. Try out the changes live in the interactive playground:


🌱 Grown from commit 73deedb


✅ Preview deployment has been cleaned up.

@marcoroth
marcoroth marked this pull request as ready for review August 11, 2026 17:45
@marcoroth
marcoroth merged commit 16d0c78 into main Aug 11, 2026
23 checks passed
@marcoroth
marcoroth deleted the analysis-render-graph branch August 11, 2026 18:04
@marcoroth
marcoroth restored the analysis-render-graph branch August 11, 2026 18:06
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

analysis language-server @herb-tools/language-server and Language Server Protocol support linter @herb-tools/linter for HTML+ERB templates linter-rule Individual linter rules and their documentation typescript TypeScript source across the javascript/ packages

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant