C#: Add documentation comment LST infrastructure#7015
Open
jkschneider wants to merge 1 commit intomainfrom
Open
C#: Add documentation comment LST infrastructure#7015jkschneider wants to merge 1 commit intomainfrom
jkschneider wants to merge 1 commit intomainfrom
Conversation
Add a structured LST for C# XML documentation comments (///) following the same architectural pattern as Java's Javadoc support: separate tree hierarchy, visitor with bidirectional CSharpVisitor bridge, and printer. Java side: - CsDocComment interface (extends Tree) with 8 node types: DocComment, XmlElement, XmlEmptyElement, XmlText, XmlAttribute, XmlCrefAttribute, XmlNameAttribute, LineBreak - CsDocCommentVisitor with bridge to CSharpVisitor for cref references - CsDocCommentPrinter for serializing back to /// XML format - CsDocCommentParser for converting raw text to structured tree - CsDocCommentRawComment for RPC-compatible raw comment transport - CSharpVisitor.visitSpace() override to detect and process doc comments C# side: - XmlDocComment class extending Comment for grouped /// lines - FormatWithComments groups consecutive /// lines into single XmlDocComment - CSharpPrinter handles XmlDocComment output - RPC type mappings for XmlDocComment <-> CsDocCommentRawComment
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
///) following the same architectural pattern as Java's Javadoc supportCsDocCommentinterface with 8 node types (vs Javadoc's ~31) using a generic XML model since C# doc comments are XML-nativeCsDocCommentVisitorwith bidirectionalCSharpVisitorbridge forcreftype referencesCsDocCommentPrinterandCsDocCommentParserfor round-trip fidelity///lines into a singleXmlDocCommentinFormatWithCommentsXmlDocCommentand JavaCsDocCommentRawCommentWhy not reuse Javadoc?
Javadoc models
@param name descpositional syntax with ~31 tag-specific types. C# doc comments are XML (<param name="x">desc</param>) — fundamentally different structure. The architectural pattern is identical (separate tree hierarchy, DocComment implementing Comment, visitor with language visitor bridge viavisitSpace()), but the node types are XML-centric.Architecture
Test plan
crefreferences get type attribution