Skip to content

Fix constructor XML docs, add operator page support, wire MSBuild Api…#16

Merged
Malcolmnixon merged 4 commits into
mainfrom
doc-corrections
Jun 9, 2026
Merged

Fix constructor XML docs, add operator page support, wire MSBuild Api…#16
Malcolmnixon merged 4 commits into
mainfrom
doc-corrections

Conversation

@Malcolmnixon

Copy link
Copy Markdown
Member

…MarkApiHeaders

Gap 1 - Constructor summary/params ignored (DotNetGenerator):

  • BuildMethodId: map IL '.ctor' to '#ctor' so the XML doc lookup matches the compiler-generated member ID format
  • Add tests: ConstructorWithXmlSummary_WritesSummaryToMemberPage, ConstructorWithXmlParams_WritesParamDescriptionsToMemberPage
  • Link new tests to ApiMarkDotNet-DotNetGenerator-ReadXmlDocumentationComments

Gap 2 - Operators absent from generated docs (DotNetGenerator):

  • IsSpecialNameNonConstructor: exclude op_* from the special-name filter so operator methods reach GetVisibleMembers
  • Add IsOperator, GetOperatorCSharpName, GetOperatorSymbol, and BuildOperatorSignature helpers for readable C# operator display
  • BuildMethodSignature and GetMethodGroupName dispatch to operator helpers for correct signatures and display names
  • WriteTypePage: separate operators before the collision-detection loop; emit an Operators section linking to operators.md
  • Add WriteTypeOperatorsPage (mirrors C++ WriteClassOperatorsPage)
  • Add operators row to the api.md file naming convention table
  • Add OperatorsClass fixture with documented constructor and two operators
  • Add tests: CreatesOperatorsPage, TypePageHasOperatorsSection, OperatorsPageContainsSummaries, OperatorsPageUsesSymbolHeadings
  • Add requirement ApiMarkDotNet-DotNetGenerator-DocumentOperatorOverloads at unit and system level with full test coverage

Gap 3 - ApiMarkApiHeaders not wired in MSBuild targets:

  • Add ApiMarkApiHeaders property to ApiMarkTask invocation in targets file
  • Add ForwardApiHeaders to system-level requirement children list
  • Add acceptance criterion and test scenario to verification doc

…MarkApiHeaders

Gap 1 - Constructor summary/params ignored (DotNetGenerator):
- BuildMethodId: map IL '.ctor' to '#ctor' so the XML doc lookup
  matches the compiler-generated member ID format
- Add tests: ConstructorWithXmlSummary_WritesSummaryToMemberPage,
  ConstructorWithXmlParams_WritesParamDescriptionsToMemberPage
- Link new tests to ApiMarkDotNet-DotNetGenerator-ReadXmlDocumentationComments

Gap 2 - Operators absent from generated docs (DotNetGenerator):
- IsSpecialNameNonConstructor: exclude op_* from the special-name
  filter so operator methods reach GetVisibleMembers
- Add IsOperator, GetOperatorCSharpName, GetOperatorSymbol, and
  BuildOperatorSignature helpers for readable C# operator display
- BuildMethodSignature and GetMethodGroupName dispatch to operator
  helpers for correct signatures and display names
- WriteTypePage: separate operators before the collision-detection
  loop; emit an Operators section linking to operators.md
- Add WriteTypeOperatorsPage (mirrors C++ WriteClassOperatorsPage)
- Add operators row to the api.md file naming convention table
- Add OperatorsClass fixture with documented constructor and two operators
- Add tests: CreatesOperatorsPage, TypePageHasOperatorsSection,
  OperatorsPageContainsSummaries, OperatorsPageUsesSymbolHeadings
- Add requirement ApiMarkDotNet-DotNetGenerator-DocumentOperatorOverloads
  at unit and system level with full test coverage

Gap 3 - ApiMarkApiHeaders not wired in MSBuild targets:
- Add ApiMarkApiHeaders property to ApiMarkTask invocation in targets file
- Add ForwardApiHeaders to system-level requirement children list
- Add acceptance criterion and test scenario to verification doc

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Copilot AI review requested due to automatic review settings June 9, 2026 13:25

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Pull request overview

This PR closes multiple documentation-generation gaps across the .NET generator and the MSBuild integration by fixing constructor XML doc lookup, adding first-class operator overload documentation (via a per-type operators.md page), and wiring ApiMarkApiHeaders through the MSBuild targets. It also updates fixtures/tests plus requirement/verification docs to reflect and validate the new behavior.

Changes:

  • Fix constructor XML doc member ID generation by mapping IL .ctor to XML-doc #ctor, with regression tests for constructor summaries and parameter docs.
  • Add operator overload documentation: exclude op_* methods from the special-name filter, generate a per-type operators.md page, and link it from the type page (with tests + fixture).
  • Wire ApiMarkApiHeaders into the MSBuild target invocation and update reqstream/verification docs accordingly.

Reviewed changes

Copilot reviewed 9 out of 9 changed files in this pull request and generated 5 comments.

Show a summary per file
File Description
test/ApiMark.DotNet.Tests/DotNetGeneratorTests.cs Adds regression/unit tests for constructor XML docs and operator pages.
test/ApiMark.DotNet.Fixtures/OperatorsClass.cs Adds a fixture type containing documented ctor + operator overloads.
src/ApiMark.MSBuild/build/DemaConsulting.ApiMark.MSBuild.targets Forwards ApiMarkApiHeaders into ApiMarkTask.
src/ApiMark.DotNet/DotNetGenerator.cs Implements constructor #ctor doc ID mapping and operator-page generation/signatures.
docs/verification/api-mark-msbuild.md Documents/validates ApiMarkApiHeaders forwarding behavior (formatting needs fix).
docs/verification/api-mark-dot-net/dot-net-generator.md Documents/validates constructor XML docs + operator overload behavior (formatting needs fix).
docs/reqstream/api-mark-msbuild.yaml Adds ForwardApiHeaders requirement under MSBuild task requirements.
docs/reqstream/api-mark-dot-net/dot-net-generator.yaml Adds requirements/tests for constructor XML docs + operator overload documentation.
docs/reqstream/api-mark-dot-net.yaml Links operator overload documentation requirement into the overall .NET reqstream.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread src/ApiMark.DotNet/DotNetGenerator.cs
Comment thread src/ApiMark.DotNet/DotNetGenerator.cs
Comment thread test/ApiMark.DotNet.Fixtures/OperatorsStruct.cs
Comment thread docs/verification/api-mark-msbuild.md
Comment thread docs/verification/api-mark-dot-net/dot-net-generator.md
Malcolm Nixon and others added 2 commits June 9, 2026 09:45
- Fix BuildMethodId to append ~ReturnType suffix for op_Implicit/op_Explicit
  so conversion operator XML doc summaries are correctly resolved
- Add parameter-type tie-breaker to operator ordering for deterministic output
- Rename OperatorsClass fixture to OperatorsStruct to match project conventions
- Restore dropped bold headings in api-mark-msbuild.md and dot-net-generator.md

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
- Add implicit operator double and explicit operator int to OperatorsStruct
  fixture with full XML documentation
- Add TypeWithConversionOperators_OperatorsPageContainsSummaries test:
  verifies the ~ReturnType XML doc ID suffix resolves conversion operator
  summaries onto the operators page
- Add TypeWithConversionOperators_OperatorsPageUsesConversionSyntax test:
  verifies headings use 'implicit operator T' / 'explicit operator T' syntax
  rather than op_Implicit / op_Explicit IL names
- Extend DocumentOperatorOverloads requirement justification to call out the
  ~ReturnType suffix behaviour and link both new tests
- Add conversion operator scenario to verification doc

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Copilot AI review requested due to automatic review settings June 9, 2026 13:55

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Pull request overview

Copilot reviewed 9 out of 9 changed files in this pull request and generated 1 comment.

Comment thread src/ApiMark.DotNet/DotNetGenerator.cs
- Add GetVisibleNestedTypes helper to DotNetGenerator; WriteTypePage now
  emits a Nested Types section and recursively writes nested type pages at
  {NamespacePath}/{TypeName}/{NestedTypeName}.md, matching the C++ pattern
- Add 'Nested type' row to the api.md convention table
- Fix BuildMethodId: apply Replace('/','.')  to ReturnType.FullName in the
  ~ReturnType suffix for op_Implicit/op_Explicit so conversion operators
  returning nested types resolve XML doc summaries correctly
- Add OuterClass fixture with public nested Inner class (both documented)
- Add Wrapped nested struct and implicit operator Wrapped to OperatorsStruct
  to exercise the ~ReturnType normalization with a nested return type
- Add 4 tests: NestedClass_CreatesNestedClassPage,
  NestedClass_ListedOnOuterClassPage, NestedClass_PageContainsSummary,
  ConversionOperatorReturningNestedType_OperatorsPageContainsSummary
- Add ApiMarkDotNet-DotNetGenerator-DocumentNestedTypes requirement
- Link nested-return-type test to DocumentOperatorOverloads requirement
- Add 3 verification scenarios for nested types and ~ReturnType normalization

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
@Malcolmnixon Malcolmnixon merged commit 2d519b7 into main Jun 9, 2026
15 checks passed
@Malcolmnixon Malcolmnixon deleted the doc-corrections branch June 9, 2026 14:41
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