Skip to content

Comments

System.Reflection.Metadata: migrate XML docs (fill-gaps)#2

Open
richlander wants to merge 1 commit intomainfrom
dev/richlander/metadata-xmldocs
Open

System.Reflection.Metadata: migrate XML docs (fill-gaps)#2
richlander wants to merge 1 commit intomainfrom
dev/richlander/metadata-xmldocs

Conversation

@richlander
Copy link
Owner

Doc-only migration for System.Reflection.Metadata — 192 types, 19 files modified, +415 lines. Generated by slash merge --mode fill-gaps. See richlander/runtime#1 for full context on the approach, tooling, and design goals.

Quality: before → after

main This branch Delta
Types 178/192 Good (92.7%) 178/192 Good (92.7%)
Members: Good 1,310/1,738 (75.4%) 1,331/1,782 (74.7%) +21
Members: None 15 (0.9%) 38 (2.1%) +23 new members discovered
Conflicts: Significant 113 113
Conflicts: Cosmetic 77 78 +1
Samples 0 0

The member count increased from 1,738 to 1,782 because fill-gaps adds /// comments to members that previously had no C# docs, making them visible to the quality analyzer. The 21 newly-Good members are gaps that were filled from dotnet-api-docs XML.

This is a doc-only migration — no samples were added. Samples would be a follow-up pass using the LLM agent fleet workflow described in PR #1.

Note: This PR is for review and discussion — not intended for merge.

192 types processed, 21 files modified. Doc-only migration from
dotnet-api-docs using slash merge --mode fill-gaps.

Quality before: 1310/1738 Good (75.4%)
Quality after:  1331/1782 Good (74.7%), gaps filled where C# had none

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
#endif

/// <summary>
/// Initializes a new instance of the AssemblyNameInfo class.
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This comment is on a wrong method

/// <exception cref="InvalidOperationException">Builder is not writable, it has been linked with another one.</exception>
/// <exception cref="T:System.ArgumentOutOfRangeException"><paramref name="byteCount"/> is negative.</exception>
/// <exception cref="T:System.InvalidOperationException">The builder is not writable, it has been linked with another one.</exception>
internal void WriteBytes(ReadOnlySpan<byte> buffer)
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Wrong method. The doc comment should be on the public ones.

private uint FrozenLength => _length | IsFrozenMask;
private Span<byte> Span => _buffer.AsSpan(0, Length);

/// <param name="capacity">To be added.</param>
Copy link

@jkotas jkotas Feb 21, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should we omit these "To be added" comments (or replace them with AI generated boilerplate)? It is easy to scan for public APIs with missing docs anytime. We do not have to have placeholders for it.

namespace System.Reflection.Metadata
{
/// <summary>
/// Represents the method body in ECMA 335 assembly.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
/// Represents the method body in ECMA 335 assembly.
/// Represents the method body in ECMA-335 assembly.

/// The method body contains Common Intermediate Language (CIL) instructions that make up a method and information about its local variables and exception regions. You can use the <see cref="System.Reflection.Metadata.PEReaderExtensions.GetMethodBody"/> method to get a <c>MethodBodyBlock</c> instance for the specified method.
/// The format of CIL instructions and metadata is defined by the ECMA-335 specification. For more information, see [Standard ECMA-335 - Common Language Infrastructure (CLI)](https://www.ecma-international.org/publications-and-standards/standards/ecma-335/) on the Ecma International Web site.
/// This example shows how to read method bodies for all methods in the specified type definition and display method body information:
/// [!code-csharp[](~/snippets/csharp/System.Reflection.Metadata/MethodBodyBlock/MethodBodyBlockSnippets.cs#PrintMethods)]

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

How are we thinking about code examples?

get { return _heapOffset == 0; }
}

/// <param name="obj">To be added.</param>

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This looks suspect.

Comment on lines +78 to +79
/// <param name="left">To be added.</param>
/// <param name="right">To be added.</param>

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Incomplete.

Comment on lines +85 to +86
/// <param name="left">To be added.</param>
/// <param name="right">To be added.</param>

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Incomplete.

WriteBytes(new ReadOnlySpan<byte>(buffer, byteCount));
}

/// <param name="value">To be added.</param>

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

My base assumption is that every item should have a <summary>. I will stop for now, but everytime I marked something "Incomplete." that is what I was implying.

namespace System.Reflection.Metadata
{
/// <summary>
/// Reads metadata as defined by the ECMA 335 CLI specification.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
/// Reads metadata as defined by the ECMA 335 CLI specification.
/// Reads metadata as defined by the ECMA-335 CLI specification.

/// You can use constructors, such as <see cref="System.Reflection.Metadata.MetadataReader.#ctor(System.Byte,System.Int32)"/>, to create an instance of <see cref="System.Reflection.Metadata.MetadataReader"/> for a given memory location. To read metadata from the Portable Executable assembly file, create <see cref="System.Reflection.PortableExecutable.PEReader"/> and use the <see cref="System.Reflection.Metadata.PEReaderExtensions.GetMetadataReader(System.Reflection.PortableExecutable.PEReader)"/> extension method.
/// The format of CLI metadata is defined by the ECMA-335 specification. For more information, see [Standard ECMA-335 - Common Language Infrastructure (CLI)](https://www.ecma-international.org/publications-and-standards/standards/ecma-335/) on the Ecma International Web site.
/// This example shows how to create <see cref="System.Reflection.Metadata.MetadataReader"/> for an assembly and read all type definitions from it:
/// <code lang="csharp" source="~/snippets/csharp/System.Reflection.Metadata/MetadataReader/MetadataReaderSnippets.cs" id="SnippetMetadataReader" />

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code snippet.

namespace System.Reflection.Metadata
{
/// <summary>
/// Reads metadata as defined by the ECMA 335 CLI specification.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
/// Reads metadata as defined by the ECMA 335 CLI specification.
/// Reads metadata as defined by the ECMA-335 CLI specification.

/// You can use constructors, such as <see cref="System.Reflection.Metadata.MetadataReader.#ctor(System.Byte,System.Int32)"/>, to create an instance of <see cref="System.Reflection.Metadata.MetadataReader"/> for a given memory location. To read metadata from the Portable Executable assembly file, create <see cref="System.Reflection.PortableExecutable.PEReader"/> and use the <see cref="System.Reflection.Metadata.PEReaderExtensions.GetMetadataReader(System.Reflection.PortableExecutable.PEReader)"/> extension method.
/// The format of CLI metadata is defined by the ECMA-335 specification. For more information, see [Standard ECMA-335 - Common Language Infrastructure (CLI)](https://www.ecma-international.org/publications-and-standards/standards/ecma-335/) on the Ecma International Web site.
/// This example shows how to create <see cref="System.Reflection.Metadata.MetadataReader"/> for an assembly and read all type definitions from it:
/// <code lang="csharp" source="~/snippets/csharp/System.Reflection.Metadata/MetadataReader/MetadataReaderSnippets.cs" id="SnippetMetadataReader" />

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code snippet.

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.

3 participants