Add JSDoc generation from C# XML documentation comments#78
Add JSDoc generation from C# XML documentation comments#78
Conversation
Co-authored-by: ArcadeMode <5969155+ArcadeMode@users.noreply.github.com>
Co-authored-by: ArcadeMode <5969155+ArcadeMode@users.noreply.github.com>
Co-authored-by: ArcadeMode <5969155+ArcadeMode@users.noreply.github.com>
… endings Co-authored-by: ArcadeMode <5969155+ArcadeMode@users.noreply.github.com>
Co-authored-by: ArcadeMode <5969155+ArcadeMode@users.noreply.github.com>
Co-authored-by: ArcadeMode <5969155+ArcadeMode@users.noreply.github.com>
ArcadeMode
left a comment
There was a problem hiding this comment.
Add a new class with tests to the generator.tests project that demonstrate various comments with different contents
…class Co-authored-by: ArcadeMode <5969155+ArcadeMode@users.noreply.github.com>
Added a comprehensive test in commit a46561b that demonstrates a Calculator class with various comment types including:
The test validates all JSDoc features working together in a single realistic example. All 12 JSDoc tests pass. |
ArcadeMode
left a comment
There was a problem hiding this comment.
Remove the last added test (the comprehensive one) the rest is fine. Then change the new renderer to not use interpolation expressions, instead chain append and appendline calls on the render context to not cause unnecessary intermediate string allocations
Do add tests for rendering with other tags like bold and italics. Also show the inner tag parsing inside throws returns and params
… tests Co-authored-by: ArcadeMode <5969155+ArcadeMode@users.noreply.github.com>
Changes completed in commit 00f462c:
All 503 tests pass. |
Generates JSDoc comments in TypeScript user class proxies from C# XML documentation. Parses
<summary>,<remarks>,<param>,<returns>, and<exception>tags from Roslyn symbols during code generation.Implementation
CommentInfo,ParameterCommentInfo,ThrowsCommentInfoclasses withCommentInfoBuilderthat extracts XML fromISymbol.GetDocumentationCommentXml()Commentproperty toClassInfo,MethodInfo,PropertyInfoClassInfoBuilder,MethodInfoBuilder,PropertyInfoBuildernow populateCommentviaCommentInfoBuilderTypeScriptJSDocRendererconvertsCommentInfoto JSDoc format using chainedctx.Append().AppendLine()calls to avoid unnecessary string allocations, integrated intoTypescriptUserClassProxyRendererandTypeScriptMethodRendererXML Tag Transformations
Transforms C# XML tags to JSDoc-compatible markdown:
<c>,<code>→ inline code backticks<paramref name="x"/>→`x`<see cref="T:Type"/>→`Type`(strips namespace and prefixes)<b>,<strong>→**bold**<i>,<em>→*italic*<summary>+<remarks>→ combined description with blank line separatorExample
C# with XML comments:
Generated TypeScript:
Testing
Added
TypeScriptJSDocTestswith 16 test cases covering:<b>,<i>,<c>,<paramref>) in params, returns, and throwsOriginal prompt
💬 We'd love your input! Share your thoughts on Copilot coding agent in our 2 minute survey.