Skip to content

Conversation

@DustinCampbell
Copy link
Member

This change takes some updates from Roslyn's C# syntax generator tool to greatly reduce the code system of the generated syntax files.

  • Syntax.xml.Main.Generated.cs - Reduced from 1604 lines to 871 lines
  • Syntax.xml.Syntax.Generated.cs - Reduced from 4128 lines to 2198 lines
  • Syntax.xml.Internal.Generated.cs - Reduced from 5321 lines to 3822 lines

Add a launchSettings.json file that allows the RazorSyntaxGenerator to be run from the IDE with command-line arguments that point to Razor's Syntax.xml file and Generated sub folder.
- Add Block(),Indent(), and WriteIndentedLine() helpers
- Don't hard-code indentation for every line
- Use file-scoped namespaces
Clean up the syntax generator for green nodes (i.e. InternalSyntax) and significantly reduce the generated code size for green nodes.
Clean up the syntax generator for red nodes and factories, and significantly reduce generated code size for red nodes.
@DustinCampbell DustinCampbell requested a review from a team as a code owner May 1, 2025 18:53
@DustinCampbell DustinCampbell merged commit e0af43a into dotnet:main May 1, 2025
11 checks passed
@DustinCampbell DustinCampbell deleted the razorsyntaxgenerator branch May 1, 2025 22:01
@dotnet-policy-service dotnet-policy-service bot added this to the Next milestone May 1, 2025
@RikkiGibson RikkiGibson modified the milestones: Next, 18.0 P1 Aug 20, 2025
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.

4 participants