Commit e25dfe8
Emit XML doc comments from schema descriptions in C# codegen
Update the C# code generator (csharp.ts) to emit /// <summary> XML doc
comments on all generated types and members, sourced from JSON Schema
description annotations.
Changes to scripts/codegen/csharp.ts:
- Add escapeXml(), ensureTrailingPunctuation(), xmlDocComment(),
rawXmlDocSummary(), and xmlDocCommentWithFallback() helpers
- Emit <summary> on all data classes, nested classes, polymorphic base
and derived classes, enum types, and enum members
- Emit <remarks> with event name on SessionEvent-derived classes when a
real schema description is present
- Emit <inheritdoc /> on all override string Type properties
- Emit <see cref> cross-references in data class fallback summaries
- Use <c> tags for event names and discriminator values
- Ensure all comments end with sentence-ending punctuation
- Add synthetic fallback summaries for types without schema descriptions
- Apply XML escaping to schema-sourced text; skip escaping for
codegen-controlled XML tags
Regenerated output (from published @github/copilot v1.0.2 schemas):
- SessionEvents.cs: ~525 <summary> + 69 <inheritdoc> comments
- Rpc.cs: class-level and property-level docs with fallbacks
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>1 parent 11dde6e commit e25dfe8
File tree
3 files changed
+1030
-268
lines changed- dotnet/src/Generated
- scripts/codegen
3 files changed
+1030
-268
lines changed
0 commit comments