Commit d9ca32c
Refactor visitor subclasses to produce unresolved tag helper nodes
With the shared infrastructure in place, refactor all three visitor subclasses to produce unresolved IR nodes instead of resolved tag helper nodes.
**Core architectural change:**
Switch ExecuteCore to use the pre-tag-helper syntax tree. The lowering phase now runs before the tag helper rewrite phase, so elements that might be tag helpers appear as regular MarkupElementSyntax (not MarkupTagHelperElementSyntax). This means the VisitMarkupTagHelper* methods are no longer called and can be removed. Instead, ALL elements are lowered as unresolved ElementOrTagHelperIntermediateNode, with pre-computed data for the resolution phase.
**LegacyFileKindVisitor changes:**
- VisitMarkupElement now wraps all elements in ElementOrTagHelperIntermediateNode with pre-computed boundary indices (StartTagEndIndex, BodyEndIndex), extracted attribute data, and tag structure flags
- VisitMarkupAttributeBlock creates MarkupOrTagHelperAttributeIntermediateNode with two pre-computed fallback forms: AsTagHelperAttribute (merged attribute value via base VisitAttributeValue) and AsMarkupAttribute (full attribute as HTML via new LowerAttributeAsHtml)
- Removed 7 VisitMarkupTagHelper* overrides (dead code with pre-rewrite tree)
- Removed duplicate VisitAttributeValue/Combine (now inherited from base)
- VisitHtmlContent gains boundary awareness to prevent merging across regions
**ComponentFileKindVisitor changes:**
- Same unresolved pattern: VisitMarkupElement wraps in ElementOrTagHelperIntermediateNode with IsComponent=true
- Attributes get fallback forms like Legacy
- Removed 9 VisitMarkupTagHelper* overrides and duplicate methods
- Removed LooksLikeAComponentName (moved to top-level in prior commit)
**ComponentImportFileKindVisitor changes:**
- Removed dead DefaultVisit and VisitMarkupTagHelperElement overrides
- Uses ComputeSourceSpanFromChildren helper (added in prior commit)
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>1 parent 2ddcd5f commit d9ca32c
1 file changed
Lines changed: 568 additions & 1042 deletions
File tree
- src/Compiler/Microsoft.CodeAnalysis.Razor.Compiler/src/Language
0 commit comments