feat(extract): extend extract_razor() with MVC/CSHTML view patterns#1085
Open
adrianabadin wants to merge 1 commit into
Open
feat(extract): extend extract_razor() with MVC/CSHTML view patterns#1085adrianabadin wants to merge 1 commit into
adrianabadin wants to merge 1 commit into
Conversation
Adds support for Razor MVC view-specific constructs that were missing from the Blazor-focused extract_razor() implementation: - Layout = ... → extends edge - Html.Partial / PartialAsync / RenderPartial / RenderPartialAsync → includes edge - Component.InvokeAsync(Name) → invokes_component edge - @section Name → defines_section edge - @RenderSection / @RenderSectionAsync → renders_section edge - asp-controller + asp-action correlation (within 3-line proximity) → navigates_to edge - asp-page → links_to_page edge - <form method=post asp-action=...> → submits_post_to / submits_get_to edge - Non-standard HTML elements with asp-* attrs → uses_taghelper edge (TagHelper convention) Also adds: - tests/fixtures/sample.cshtml: MVC Razor view fixture covering all new patterns - 11 new tests in test_dotnet.py for .cshtml extraction - Razor/CSHTML guidance in skill-windows.md subagent prompt All 26 tests in test_dotnet.py pass. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
adrianabadin
added a commit
to adrianabadin/memory-context
that referenced
this pull request
Jun 2, 2026
Temporarily points setup.mjs and bootstrap.mjs at the fork adrianabadin/graphify feat/cshtml-mvc-razor-extraction, which extends extract_razor() with MVC CSHTML patterns (Layout, Html.Partial, asp-controller/action, form submissions, TagHelpers). PR submitted upstream: safishamsi/graphify#1085. Revert once the PR is merged and a new version is on PyPI. Also updates README: documents fork dependency with revert instructions, corrects graphifyy attribution (obra to safishamsi), adds PR link. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
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.
Summary
extract_razor()ingraphify/extract.pywith ASP.NET MVC Razor view patterns that were missing from the existing Blazor-focused implementationtests/fixtures/sample.cshtmlfixture covering all new patternstest_dotnet.py(26/26 pass)skill-windows.mdsubagent promptNew edge types extracted from
.cshtmlfilesLayout = ~/Views/Shared/_Layout.cshtmlextendsHtml.Partial / PartialAsync / RenderPartialincludesComponent.InvokeAsync(Name)invokes_component@section Namedefines_section@RenderSection / @RenderSectionAsyncrenders_sectionasp-controller + asp-action(proximity-correlated)navigates_toasp-page=...links_to_page<form method=post asp-action=...>submits_post_to/submits_get_toasp-*attributesuses_taghelperMotivation
.cshtmlfiles were already inCODE_EXTENSIONSand routed toextract_razor(), but the function only handled Blazor patterns (@using,@inject,@inherits,@page, PascalCase components,@codemethods). ASP.NET MVC views use a different set of constructs — layout inheritance, partial views, ViewComponents, Tag Helpers, form submissions — that produced empty graphs for MVC projects.Validated on a real ASP.NET MVC project (42
.cshtmlfiles): 112 nodes and 150 edges extracted, 0 errors.Test plan
python -m pytest tests/test_dotnet.py→ 26 passedsample.cshtmlcovers all 9 new edge typestest_cshtml_missing_fileverifies error handling is consistent with existing.razorbehavior🤖 Generated with Claude Code