feat(graph): index HTML files so templates are findable by name (#150) - #196
feat(graph): index HTML files so templates are findable by name (#150)#196Frankie-Xu wants to merge 1 commit into
Conversation
…Nets#150) Co-authored-by: Cursor <cursoragent@cursor.com>
b4d5c3d to
2b333dc
Compare
|
Rebased onto current
|
🌱 graft blast radius1 area changed → 4 areas can be affected. 11 dependent symbols, depth 2. flowchart TB
A0(("Dependency Graph<br/>7 symbols"))
A1(("CLI Engine<br/>2 symbols"))
A2(("LSP Enrichment<br/>1 symbol"))
A3(("MCP Tools<br/>1 symbol"))
classDef reached fill:#D9EDF3,stroke:#3AA7C9,stroke-width:1.5px,color:#0E313C;
class A0,A1,A2,A3 reached;
All 11 dependent symbols, grouped by areaDependency Graph — 7 symbols in 7 files
CLI Engine — 2 symbols in 2 files
LSP Enrichment — 1 symbol in 1 file
MCP Tools — 1 symbol in 1 file
Test signal per changed area — 1 –Reached = a node under a test path has a resolved edge into the changed symbol. It undercounts anything called indirectly — through a CLI, a spawned process or a dynamic import — so read a low ratio as “look here”, never as a coverage gate.
30 test suites also reference this code30 symbols, kept out of the diagram and the table so they cannot crowd out the areas a reviewer has to look at.
Open the interactive graph → — click an area to see its dependent symbols at file:line. |
Summary
.html/.htm) on the breadth tier so template files get akind: "file"graph node and show up inask/grepby name — Django users no longer have to walk View class →template_nameto find the template (Support HTML files #150).tree-sitter-wasmalready shipstree-sitter-html.wasm, so this is oneGENERIC_LANGSrow (same path as Clojure/Dart). Notags.scm: HTML has no definition-shaped nodes, and the node-kind walker correctly yields a file node only (ocaml/zig precedent).Closes #150
Route tradeoff
graft build -e, and banner labeling all fall out of the existing registry.fs.ts/build.ts@definition)render/template_name→ HTML file edgesTest plan
npm run build && npm test— 868 pass, 0 failtest/generic-extract.test.ts—.html/.htmrouting; extract is file-node-only; Django-styletemplates/index.html+views.pybuild: grep hits template content,resolveSymbol("index.html")andask("index.html")hit the file nodetest/supported-extensions.test.ts—.html/.htmin the-esupported settemplates/index.html+ DjangoTemplateView):Follow-up
render("…")/template_name = "…"string literals onto the matching HTML file node. That is the "go to the template from the View" direction; this PR is the "find the template by name" direction.Made with Cursor