Skip to content

[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

Merged

Conversation

maorleger
Copy link
Member

@maorleger maorleger commented Jun 18, 2025

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 in package.json, and modifying test cases to reflect these updates.

Enhancements to documentation handling:

Resolves #7680

@maorleger maorleger changed the title [emitter-framework] Add [emitter-framework] Add support for c# xml docs Jun 18, 2025
<ay.For each={members} joiner={",\n"}>
{([key, value]) => {
return (
<>
Copy link
Member Author

@maorleger maorleger Jun 18, 2025

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;
Copy link
Member Author

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);
Copy link
Member Author

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

@maorleger maorleger marked this pull request as ready for review June 18, 2025 22:08
<>
<cs.DocWhen doc={getDocComments($, value)} />
<cs.EnumMember
name={cs.useCSharpNamePolicy().getName(key, "enum-member")}
Copy link
Member

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)

Copy link
Member Author

@maorleger maorleger Jun 18, 2025

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 👍

@maorleger maorleger merged commit 7f8508d into microsoft:feature/ef-csharp Jun 18, 2025
1 check passed
@maorleger maorleger deleted the maorleger/csharp-docs branch June 19, 2025 14:48
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants