Summary
GeneratedSource.cs exists solely to undo a CodeBlocker behaviour:
internal static string NormalizeLineEndings(string source) =>
source.Replace("\r\n", "\n").Replace("\n", "\r\n");
Its own remarks say why:
ktsu.CodeBlocker writes through IndentedTextWriter, which uses Environment.NewLine — so the same metadata produced CRLF output on Windows and LF output on Linux. Generator output under Semantics.Quantities/Generated/ is committed to the repository and verified by CI, so it has to be byte-identical regardless of who builds it.
That is a workaround for a gap in the writer, not a Semantics concern. ktsu-dev/CodeBlocker#81 fixes it at the source.
Tasks
Acceptance criteria
Context
Part of #181. Blocked on ktsu-dev/CodeBlocker#81 and ktsu-dev/CodeBlocker#85.
Summary
GeneratedSource.csexists solely to undo aCodeBlockerbehaviour:Its own remarks say why:
That is a workaround for a gap in the writer, not a Semantics concern. ktsu-dev/CodeBlocker#81 fixes it at the source.
Tasks
CodeBlockerconstruction (CRLF, to matchend_of_line = crlfin.editorconfigand*.cs text eol=crlfin.gitattributes).NormalizeLineEndingsand either deleteGeneratedSource.Addor keep it as a thincontext.AddSourcewrapper if it earns its place.Environment.NewLine(Close the correctness and coverage gaps in the C# template object model CodeBlocker#85, item 4). That is a second host dependency the normalization pass does not fix — a method body assembled on Linux can be laid out differently from the same body on Windows, and post-hoc newline rewriting cannot undo a layout decision. Confirm this is closed out before deleting the pass.verify-generated.ymlcan then dropruns-on: windows-latest— it is pinned there today only so git'sautocrlfmatches the committed CRLF endings.Acceptance criteria
Semantics.Quantitieson Linux and on Windows produces byte-identical files underGenerated/.verify-generatedpasses with no normalization pass in the generator.Context
Part of #181. Blocked on ktsu-dev/CodeBlocker#81 and ktsu-dev/CodeBlocker#85.