Skip to content

Tighten C++ ownership filtering and fix operators page headings#18

Merged
Malcolmnixon merged 2 commits into
mainfrom
filter-cpp-docs
Jun 9, 2026
Merged

Tighten C++ ownership filtering and fix operators page headings#18
Malcolmnixon merged 2 commits into
mainfrom
filter-cpp-docs

Conversation

@Malcolmnixon

Copy link
Copy Markdown
Member
  • C++: track explicitly selected headers in ClangAstParser; a symbol is only owned when its defining header is both under a PublicIncludeRoot and explicitly selected via --api-headers. Prevents transitive-include symbols from leaking into generated docs.
  • C++ + .NET: capitalize operators page H1 heading to 'Operators' (proper title-cased heading); rename .NET file to Operators.md (PascalCase convention) with updated navigation links and test keys.
  • .NET: fix BuildMethodId to normalize nested-type separators ('/' -> '.') in parameter type FullNames, matching the existing return-type fix.
  • Reqstream/verification: update cpp-generator docs to reflect new ownership rules and add transitive-include regression test mapping; fix '#include' rendering typo.

- C++: track explicitly selected headers in ClangAstParser; a symbol is
  only owned when its defining header is both under a PublicIncludeRoot
  and explicitly selected via --api-headers. Prevents transitive-include
  symbols from leaking into generated docs.
- C++ + .NET: capitalize operators page H1 heading to 'Operators'
  (proper title-cased heading); rename .NET file to Operators.md
  (PascalCase convention) with updated navigation links and test keys.
- .NET: fix BuildMethodId to normalize nested-type separators ('/' -> '.')
  in parameter type FullNames, matching the existing return-type fix.
- Reqstream/verification: update cpp-generator docs to reflect new
  ownership rules and add transitive-include regression test mapping;
  fix '#include' rendering typo.

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

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 tightens C++ API ownership so only symbols defined in explicitly selected --api-headers are documented (preventing transitive-include leakage), and aligns “Operators” page presentation across generators while fixing a .NET XML-doc ID normalization edge case.

Changes:

  • C++: Track explicitly selected headers in ClangAstParser and require both PublicIncludeRoot membership and explicit selection for symbol ownership; add regression test and update verification/reqstream docs.
  • .NET: Rename the per-type operators page to Operators.md, update links/tests accordingly, and title-case the operators page H1 to Operators.
  • .NET: Fix BuildMethodId to normalize nested-type separators (/.) in parameter type full names (matching existing return-type behavior).

Reviewed changes

Copilot reviewed 7 out of 7 changed files in this pull request and generated 3 comments.

Show a summary per file
File Description
test/ApiMark.DotNet.Tests/DotNetGeneratorTests.cs Updates expectations/links for Operators.md (PascalCase) in generated output.
test/ApiMark.Cpp.Tests/CppGeneratorTests.cs Adds regression coverage ensuring transitive-include symbols from non-selected headers are excluded.
src/ApiMark.DotNet/DotNetGenerator.cs Renames operators page output and normalizes nested-type separators for XML doc method IDs.
src/ApiMark.Cpp/CppGenerator.cs Title-cases the Operators page H1 headings for class/namespace operator pages.
src/ApiMark.Cpp/CppAst/ClangAstParser.cs Implements explicit-header tracking and updates ownership logic to require explicit selection.
docs/verification/api-mark-cpp/cpp-generator.md Updates verification docs to reflect the new ownership/selection behavior and test mapping.
docs/reqstream/api-mark-cpp/cpp-generator.yaml Updates requirements to reflect header-selection-based ownership and adds the new test mapping.

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

Comment thread src/ApiMark.Cpp/CppGenerator.cs
Comment thread src/ApiMark.Cpp/CppGenerator.cs
Comment thread src/ApiMark.DotNet/DotNetGenerator.cs
- Restore truncated two-line comments in WriteClassOperatorsPage and
  WriteNamespaceOperatorsPage (first half was lost when the heading
  line was inserted above them)
- Revert .NET operators page filename from 'Operators' back to
  'operators' to avoid collision with a real member named 'Operators';
  the H1 heading stays 'Operators' (title-cased)

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
@Malcolmnixon Malcolmnixon merged commit 0bfce4a into main Jun 9, 2026
15 checks passed
@Malcolmnixon Malcolmnixon deleted the filter-cpp-docs branch June 9, 2026 17:00
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