-
Notifications
You must be signed in to change notification settings - Fork 284
[emitter-framework] Add support for c# xml docs #7679
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[emitter-framework] Add support for c# xml docs #7679
Conversation
<ay.For each={members} joiner={",\n"}> | ||
{([key, value]) => { | ||
return ( | ||
<> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I need to move this into alloy next, then I can just pass doc
for enums alloy-framework/alloy#207
export function getDocComments($: Typekit, type: Type): ay.Children { | ||
const typeDoc = $.type.getDoc(type); | ||
if (!typeDoc) { | ||
return undefined; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thoughts on bailing early if there's no docs (even if there are parameters with docs)?
Feels weird to have a doc-comment with no <summary>
@@ -200,7 +200,7 @@ describe("from an interface", () => { | |||
{ | |||
class TestInterface | |||
{ | |||
public abstract string GetName(string id) {} | |||
public abstract string GetName(string id); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fixed in passing after upgrading to alloy dev.9
packages/emitter-framework/src/csharp/components/utils/doc-comments.tsx
Outdated
Show resolved
Hide resolved
<> | ||
<cs.DocWhen doc={getDocComments($, value)} /> | ||
<cs.EnumMember | ||
name={cs.useCSharpNamePolicy().getName(key, "enum-member")} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
do you actually need to call the policy here? (I know it was there before but maybe there is some other cases where this could be simplified)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
hm good Q. I've been working off of typescript ef which does the same thing but you're right that this could probably be simplified. I'll think of alternatives after I get done with class-method 👍
This pull request introduces several enhancements to the
emitter-framework
package, focusing on improved handling of documentation comments, updates to dependencies, and adjustments to test cases for better alignment with C# conventions. The most important changes include adding support for rendering doc comments in C# components, updating dependencies inpackage.json
, and modifying test cases to reflect these updates.Enhancements to documentation handling:
packages/emitter-framework/src/csharp/components/utils/doc-comments.tsx
: Added a new utility functiongetDocComments
to render doc strings for TypeSpec types, including support for parameter and return type documentation.packages/emitter-framework/src/csharp/components/class-declaration.tsx
: IntegratedgetDocComments
into class declarations, properties, and methods to include documentation in the rendered C# output. [1] [2] [3] [4]packages/emitter-framework/src/csharp/components/enum-declaration.tsx
: Added support for rendering doc comments for enum members using thegetDocComments
utility. [1] [2]Resolves #7680