Skip to content

Enhance type signatures with direct base classes and interfaces#15

Merged
Malcolmnixon merged 31 commits into
mainfrom
inhertitance-info
Jun 9, 2026
Merged

Enhance type signatures with direct base classes and interfaces#15
Malcolmnixon merged 31 commits into
mainfrom
inhertitance-info

Conversation

@Malcolmnixon

Copy link
Copy Markdown
Member

This pull request introduces several significant improvements and new features to both the C++ and .NET documentation generators, focusing on richer type information, enhanced navigation, and better cross-referencing in generated Markdown. The most important changes include support for direct inheritance in type signatures, intra-documentation Markdown links for type references, and an "External Types" section on pages referencing external types. Additionally, the C++ parser is updated for compatibility with newer Clang AST formats, and the documentation and spell-checker wordlist are updated to reflect these enhancements.

C++ Generator Enhancements:

  • Direct Inheritance in Type Signatures:
    The C++ generator now appends a declaration line to the signature block that includes direct base class names and the final specifier when present, making inheritance chains visible without opening the header file. [1] [2]

  • Intra-Documentation Links in Table Cells:
    Table cells referencing types documented in the same library now emit Markdown links for easier navigation. This is implemented via the new CppTypeLinkResolver, which resolves type strings to links or tracks them as external if not found. [1] [2] [3] [4]

  • External Types Section:
    Pages that reference at least one non-std external type now include an "External Types" section at the bottom, listing all such types and their namespaces, using the new CppExternalTypeInfo record for sorting and display. [1] [2] [3]

  • Clang AST Parser Compatibility:
    The parser now supports both Clang 18+ (using the top-level bases array) and earlier Clang versions (using CXXBaseSpecifier nodes), ensuring robust base class extraction across toolchains. [1] [2]

.NET Generator Enhancements:

  • Direct Inheritance in Type Signatures:
    The .NET generator now includes direct base class and interface names in type signatures, omitting well-known implicit bases, for improved clarity in documentation. [1] [2]

  • Intra-Documentation Links and External Types:
    Table cells referencing types in the same assembly now emit Markdown links, and pages that reference external non-System types include an "External Types" section at the bottom, listing these types and their namespaces. [1] [2]

Documentation and Metadata Updates:

  • Feature and Requirement Documentation:
    The requirements YAML files and design docs are updated to describe the new features, including direct inheritance, intra-doc links, and external types sections for both C++ and .NET. [1] [2] [3] [4] [5] [6]

  • README and Spellchecker:
    The README.md is updated with new badges and clearer feature descriptions, and .cspell.yaml adds new terms related to linkification and type references. [1] [2] [3]

Malcolmnixon and others added 7 commits June 8, 2026 10:25
DotNetGenerator.BuildTypeSignature now appends ': BaseClass, IInterface'
for classes/interfaces/structs that have direct base types or interfaces,
skipping System.Object, System.ValueType, System.Enum, and
System.MulticastDelegate. CppGenerator class signatures now include
direct base classes from CppClass.BaseTypes.

ClangAstParser updated to read base class information from the top-level
'bases' array introduced in clang 18 (in addition to the legacy
CXXBaseSpecifier nodes in 'inner' for backward compatibility with older
clang versions).

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Now using system clang (AnyCPU) rather than libclang native DLL,
so architecture-specific entries are no longer needed.

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

Type parameters (T, TKey, TValue) are not real assembly types and must
render as plain text rather than generating broken links like [T](../../T.md).

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

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 enhances both the C++ and .NET Markdown documentation generators to emit richer type information and improved navigation by (1) showing direct inheritance in type signatures, (2) linkifying intra-library/assembly type references in table cells, and (3) adding an “External Types” section per page for non-standard referenced types. It also updates the C++ AST parser to handle newer Clang JSON formats and expands tests/fixtures/docs accordingly.

Changes:

  • Add type-link resolution for table cells (C++: CppTypeLinkResolver, .NET: TypeLinkResolver) and track external type references for per-page “External Types” sections.
  • Include direct base classes/interfaces in generated type signature blocks (C++ and .NET).
  • Speed up C++ integration tests via a shared xUnit fixture and add new fixtures/tests covering linkification + external type tracking.

Reviewed changes

Copilot reviewed 21 out of 21 changed files in this pull request and generated 11 comments.

Show a summary per file
File Description
test/ApiMark.DotNet.Tests/DotNetGeneratorTests.cs Adds integration tests for .NET type signatures, intra-assembly links, and External Types section.
test/ApiMark.DotNet.Fixtures/TypeLinkFixture.cs New .NET fixture type used to exercise intra-assembly links and external parameter types.
test/ApiMark.DotNet.Fixtures/SampleImplementation.cs New .NET fixture demonstrating interface inheritance in signatures.
test/ApiMark.DotNet.Fixtures/ApiMark.DotNet.Fixtures.csproj Adds Logging.Abstractions dependency needed for external type tests.
test/ApiMark.Cpp.Tests/CppGeneratorTests.cs Refactors tests to use a shared fixture and adds tests for C++ linkification/external type tracking.
test/ApiMark.Cpp.Tests/CppGeneratorFixture.cs New xUnit fixture to cache generator outputs and reduce clang invocations.
test/ApiMark.Cpp.Fixtures/include/fixtures/TypeLinkClass.h New C++ fixture type used to test intra-library type linkification.
src/ApiMark.DotNet/TypeNameSimplifier.cs Exposes StripArity internally for reuse by link resolver.
src/ApiMark.DotNet/TypeLinkResolver.cs New resolver that emits Markdown links for intra-assembly types and tracks external types.
src/ApiMark.DotNet/ExternalTypeInfo.cs New record representing an external .NET type for sorted “External Types” output.
src/ApiMark.DotNet/DotNetGenerator.cs Wires in type linkification, external type tracking/section emission, and direct inheritance in signatures.
src/ApiMark.Cpp/CppTypeLinkResolver.cs New resolver that linkifies known C++ types and tracks external namespaced types.
src/ApiMark.Cpp/CppGenerator.cs Wires in C++ type linkification, external type tracking/section emission, and direct inheritance in signature blocks.
src/ApiMark.Cpp/CppExternalTypeInfo.cs New record representing an external C++ type for sorted “External Types” output.
src/ApiMark.Cpp/CppAst/ClangAstParser.cs Updates base-class parsing to support Clang 18+ bases array while keeping older behavior.
README.md Updates badges and feature list to reflect new navigation/type-info capabilities.
docs/reqstream/api-mark-dot-net/dot-net-generator.yaml Adds requirements coverage for direct inheritance, intra-doc links, and external types section (.NET).
docs/reqstream/api-mark-cpp/cpp-generator.yaml Adds requirements coverage for direct inheritance, intra-doc links, and external types section (C++).
docs/design/api-mark-dot-net/dot-net-generator.md Documents new .NET linkification/external types design and signature inheritance behavior.
docs/design/api-mark-cpp/cpp-generator.md Documents new C++ linkification/external types design and signature inheritance behavior.
.cspell.yaml Adds new spellchecker terms related to linkification.

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

Comment thread src/ApiMark.Cpp/CppTypeLinkResolver.cs
Comment thread src/ApiMark.DotNet/ExternalTypeInfo.cs Outdated
Comment thread src/ApiMark.Cpp/CppExternalTypeInfo.cs Outdated
Comment thread src/ApiMark.DotNet/DotNetGenerator.cs
Comment thread src/ApiMark.DotNet/DotNetGenerator.cs
Comment thread src/ApiMark.DotNet/DotNetGenerator.cs
Comment thread src/ApiMark.DotNet/DotNetGenerator.cs
Comment thread src/ApiMark.Cpp/CppGenerator.cs
Comment thread src/ApiMark.Cpp/CppGenerator.cs
Comment thread src/ApiMark.Cpp/CppGenerator.cs
Malcolmnixon and others added 2 commits June 8, 2026 13:03
…heading levels

- CppTypeLinkResolver: preserve const/*/& qualifiers around intra-doc links
  e.g. 'const Shape *' becomes 'const [Shape](path.md) *' not '[Shape](path.md)'
- ExternalTypeInfo.CompareTo: add Namespace as tie-breaker so SortedSet
  retains distinct types that share a short name but differ in namespace
- CppExternalTypeInfo.CompareTo: same tie-breaker fix for C++
- WriteExternalTypesSection: accept headingLevel parameter; type pages use
  H3 (alongside Methods/Properties), member pages use H4

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
- --search-paths exposes AdditionalIncludePaths (compiler-only -I paths)
- --include-patterns and --exclude-patterns for explicit glob filtering
- Inline ! and glob entries in --includes auto-classified into the
  correct bucket (roots / include-patterns / exclude-patterns)
- MSBuild ApiMarkSearchPaths property wires up --search-paths
- Same inline classification applied to ApiMarkIncludePaths in MSBuild

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Copilot AI review requested due to automatic review settings June 8, 2026 19: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

Copilot reviewed 36 out of 36 changed files in this pull request and generated 4 comments.

Comment thread src/ApiMark.Tool/Program.cs Outdated
Comment thread src/ApiMark.Tool/Cli/Context.cs Outdated
Comment thread src/ApiMark.MSBuild/ApiMarkTask.cs Outdated
Comment thread src/ApiMark.Cpp/CppGenerator.cs
Malcolmnixon and others added 2 commits June 8, 2026 16:22
Every generated Markdown file is a standalone document and must start
with an H1 heading. Previously, type pages opened at H2 and member
pages opened at H3, causing incorrect document structure.

Also fix pending PR review issues:
- Fix --search-paths help text to clarify it is for #include resolution
- Fix bare '!' entry handling in ClassifyIncludeEntries (Context.cs)
- Fix bare '!' entry handling in BuildArguments (ApiMarkTask.cs)

Changes:
- DotNet type pages: H2 -> H1 title; H3 sections -> H2
- DotNet member pages: H3 -> H1 title; H4 overload sections -> H2
- DotNet combined/overload pages: H3 -> H1 title; H4 sections -> H2
- C++ class sections: H3 -> H2 (class page already at H1)
- C++ member/field pages: H3 -> H1 title
- C++ enum Values section: H3 -> H2
- C++ combined member pages: H3 -> H1; H4 sections -> H2
- WriteFunctionContent/WriteFreeFunctionContent: parametersHeadingLevel
  param added (H2 standalone, H3 in combined/operators pages)
- WriteExternalTypesSection (DotNet): removed headingLevel param;
  always H2 since all pages now start at H1
- Updated all test fixtures to reflect new heading structure

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Add two tests required by unsatisfied reqstream requirements:
- CppGenerator_Generate_InheritanceClass_EmitsBaseClassInSignature
  satisfies ApiMarkCpp-CppGenerator-ShowDirectInheritanceInTypeSignature
- DotNetGenerator_Generate_EnumTypeSignature_HasNoBaseClass
  satisfies ApiMarkDotNet-DotNetGenerator-ShowDirectInheritanceInTypeSignature

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

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 36 out of 36 changed files in this pull request and generated 1 comment.

Comment thread src/ApiMark.Cpp/CppTypeLinkResolver.cs Outdated
Malcolm Nixon and others added 5 commits June 8, 2026 19:54
…olver

The full-string cppTypeString.Contains check incorrectly suppressed
linkification of intra-library types whose signatures include std::
template arguments. Only the stripped base name needs the std:: check.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
…s with --includes/--api-headers

Redesign C++ header selection flags for clarity and power:

- --includes (repeatable) replaces both --includes and --search-paths;
  all directories are passed to clang as -I paths
- --api-headers (repeatable, ordered) replaces --include-patterns and
  --exclude-patterns; supports ! antipatterns with gitignore semantics
  (last matching pattern wins, enabling include/exclude/re-include)
- Default when no --api-headers: glob **/*.h, **/*.hpp, **/*.hxx,
  **/*.h++ against all --includes directories (preserves old behavior)
- MSBuild: ApiMarkApiHeaders replaces ApiMarkSearchPaths + pattern
  properties; semicolon-separated, order-preserved
- CppGeneratorOptions: ApiHeaderPatterns replaces IncludePatterns +
  ExcludePatterns + AdditionalIncludePaths
- Tests added for default, include, exclude, and re-include scenarios

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
…lection redesign

- Remove stale requirements referencing deleted --search-paths and
  --include-patterns/--exclude-patterns tests
- Add ApiMarkMsbuild-ApiMarkTask-ForwardApiHeaders requirement
- Add ApiMarkCpp-CppGenerator-ApplyGitignoreStylePatternSelectionToHeaders requirement
- Fix malformed ApiMarkApiHeaders/ApiMarkLibraryName entry in design doc
- Update context.yaml requirements to reference new --api-headers tests

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
…ate stale requirements

- Replace 'antipattern'/'antipatterns' with 'exclusion pattern'/'exclusion patterns'
  throughout source, tests, and docs to satisfy cspell dictionary requirements
- Replace 'unconfigured' with 'runs with no configured patterns' in CppGenerator
- Rename test methods to use cspell-clean identifiers:
  ExcludeAntipattern -> ExcludePattern, WithApiHeadersAntipattern -> WithApiHeadersExclusionPattern
- Update reqstream test references to match renamed methods
- Update docs/reqstream/api-mark-tool/program.yaml to reflect --api-headers flag
  (replaces stale --search-paths/--include-patterns/--exclude-patterns references)
- Update docs/design/api-mark-tool/cli.md to remove stale flag enumeration
- Add CppGenerator_Generate_NoApiHeaderPatterns_DocumentsAllHeaders test for
  explicit default-behavior coverage (no patterns -> all headers documented)
- Add new test to reqstream traceability for ApiMarkCpp-CppGenerator-ApplyGitignoreStylePatternSelectionToHeaders

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

- CollectHeaderFiles: default (no ApiHeaderPatterns) now directly includes all
  headers under every root - no synthesized glob patterns - eliminating the
  path traversal issue when roots are outside CWD
- MatchesGlob: prefer CWD-relative matching when the file is under CWD;
  fall back to root-relative matching for absolute include roots or test
  environments where CWD != project root - pattern wildcards work in both
- All five include emitters in CppGenerator.cs now use double-quotes per
  C++ convention for user/library headers
- Update README CLI Usage with --api-headers example (include/exclude/re-include)
- Update cli-reference.md: accurate pattern-evaluation explanation
- Update msbuild-integration.md: remove incorrect 'default header glob' wording
- Update design docs: correct default-empty behavior and include quote style

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

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 39 out of 39 changed files in this pull request and generated 6 comments.

Comment thread docs/design/api-mark-tool/program.md Outdated
Comment thread test/ApiMark.Tool.Tests/ProgramTests.cs
Comment thread test/ApiMark.Tool.Tests/ProgramTests.cs
Comment thread test/ApiMark.Tool.Tests/Cli/ContextTests.cs Outdated
Comment thread src/ApiMark.Cpp/CppGenerator.cs Outdated
Comment thread src/ApiMark.Cpp/CppGenerator.cs Outdated
Malcolm Nixon and others added 2 commits June 8, 2026 22:40
1. docs/design/api-mark-tool/program.md: update CreateGenerator description to
   reflect new --includes/--api-headers wiring; remove stale SearchPaths/
   IncludePatterns/ExcludePatterns/AdditionalIncludePaths references

2. test/ApiMark.Tool.Tests/ProgramTests.cs: capture stderr in removed-flag tests
   and assert the specific 'Unsupported argument' message for --search-paths and
   --include-patterns so failures are unambiguous

3. test/ApiMark.Tool.Tests/Cli/ContextTests.cs: rename
   Context_Create_WithIncludesOption_TrimsWhitespaceAndRemovesEmptyEntries to
   Context_Create_WithRepeatedIncludesFlags_AccumulatesAllPathsInOrder; drop
   stale 'retained for history' note

4. src/ApiMark.Cpp/CppGenerator.cs: fix IsOutsideCwd check - use exact '..'
   segment and '../' prefix rather than StartsWith('..') to avoid misclassifying
   filenames like '..hidden.h'; add Path.IsPathRooted guard for different-drive
   paths on Windows

5. src/ApiMark.Cpp/CppGenerator.cs: precompile one Matcher per ApiHeaderPatterns
   entry outside both the root and file loops; replace MatchesGlob helper with
   new IsOutsideCwd helper and inline the path-selection logic

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
The C# compiler compiles every delegate into a sealed class inheriting
System.MulticastDelegate, causing ApiMark to emit "public sealed class
ServiceEvent" and list compiler-injected Invoke/BeginInvoke/EndInvoke/
constructor noise as API members.

Changes:
- DotNetGenerator.IsDelegate: new helper - true when BaseType is
  System.MulticastDelegate
- DotNetGenerator.BuildDelegateSignature: reconstructs the source-level
  'public delegate ReturnType Name(params)' from the Invoke method
- DotNetGenerator.BuildTypeSignature: dispatches to BuildDelegateSignature
  before the class/struct/enum/interface switch
- DotNetGenerator.WriteTypePage: returns immediately after emitting the
  signature and summary for delegate types, suppressing the member table
  (Invoke/BeginInvoke/EndInvoke/constructor are compiler noise, not API)
- SampleDelegate.cs: two new fixture types - ServiceEvent (void, 4 params)
  and SampleTransform<TInput,TResult> (generic, 1 param)
- DotNetGeneratorTests: three new tests covering delegate signature,
  absence of member tables, and generic type parameter rendering

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
- Parse TypeAliasDecl nodes from clang JSON into CppTypeAlias records
- Add TypeAliases collection to CppNamespaceDecl and NamespaceBuilder
- Collect type aliases in CollectResultNamespace (with deprecated filter)
- Include type aliases in the known-types map for link resolution
- Add 'Type Aliases' section to namespace summary page (Alias/Underlying Type/Description)
- Write individual type alias page with using declaration, #include, and doc summary
- Add TypeAliasFixtures.h with item_id_t and label_t aliases for testing
- Add 3 new tests: page creation, page content, and namespace page listing

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

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 43 out of 43 changed files in this pull request and generated 4 comments.

Comment thread src/ApiMark.DotNet/DotNetGenerator.cs
Comment thread src/ApiMark.Cpp/CppGenerator.cs
Comment thread test/ApiMark.Tool.Tests/ProgramTests.cs
Comment thread test/ApiMark.Tool.Tests/ProgramTests.cs
Malcolm Nixon and others added 2 commits June 9, 2026 00:06
…aliases

Code:
- Add APIMARK_CLANG_PATH environment variable support to FindClangExecutable
  with priority: ClangPath option > APIMARK_CLANG_PATH > PATH > xcrun > vswhere
- Expose ClangPathEnvVar constant for testability
- Update error message to mention APIMARK_CLANG_PATH alongside ClangPath

Requirements:
- Update Clang-Executable-Discoverable to include APIMARK_CLANG_PATH
- Add ApiMarkCpp-CppGenerator-ShowDeletedFunctionsWithDeletedNotation
- Add ApiMarkCpp-CppGenerator-DocumentTypeAliases

Design:
- Update clang.md discovery section with full priority order and env var
- Update api-mark-cpp.md clang contract section
- Update cpp-generator.md: ClangPath option, naming table, WriteTypeAliasPage,
  CppFunction.IsDeleted, Dependencies

Verification:
- Add test scenarios for deleted constructors, deleted operators, type alias
  page creation, type alias page content, and namespace page listing

User guide:
- Update --clang-path description to mention APIMARK_CLANG_PATH
- Add 'Clang executable discovery' section explaining full priority order
- Add type alias row to output structure table

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
- DotNetGenerator: add missing 'void' return type to malformed-delegate
  fallback signature (was 'public delegate Foo()'; now 'public delegate void Foo()')
- CppGenerator: use kv.Key directly as nsPath instead of replacing '.' with '/';
  the dot-separated namespace key is the actual page key used by CreateMarkdown,
  so Path.GetRelativePath in Linkify was computing wrong hrefs for nested namespaces
- ProgramTests: rename two test methods from ThrowsArgumentException to
  ReturnsNonZeroExitCode to match what they actually assert

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

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 46 out of 46 changed files in this pull request and generated 2 comments.

Comments suppressed due to low confidence (1)

src/ApiMark.DotNet/DotNetGenerator.cs:797

  • Method detail pages only linkify/track parameter types. The method return type is part of the page's signature, but it's never passed through TypeLinkResolver, so non-System external return types won't appear in the page's "External Types" section when there are no external parameters.
        var signature = BuildMethodSignature(method, namespaceName);
        memberWriter.WriteSignature("csharp", signature);

        // Always emit a summary paragraph — use the placeholder when no doc is present
        var summary = xmlDocs.GetSummary(memberId);
        memberWriter.WriteParagraph(!string.IsNullOrEmpty(summary) ? summary : NoDescriptionPlaceholder);

Comment thread src/ApiMark.Cpp/CppGenerator.cs
Comment thread src/ApiMark.Cpp/CppGenerator.cs
Malcolm Nixon and others added 2 commits June 9, 2026 00:32
…onContent

Both 'Returns' sections were using the raw simplified type name without passing
it through CppTypeLinkResolver. This meant intra-library return types were not
linkified and external return types were not tracked, leaving the 'External
Types' section incomplete for functions that return an external type but have
no parameters.

Fix: always call cppResolver.Linkify on the return type name so external types
are tracked regardless of whether a doc-comment return description is present.
The linked type name is used as the fallback paragraph text when no description
is available.

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

@note tags:
- Add Note field to CppDocComment (optional, null when absent)
- Parse @note BlockCommandComment in ClangAstParser.ParseDocComment
- Add GetNote helper in CppGenerator
- Emit '> **Note:** {text}' blockquote paragraph after @details in all content
  writers: WriteFreeFunctionContent, WriteFunctionContent, WriteFieldContent,
  WriteTypePage, WriteEnumPage, WriteTypeAliasPage

Default parameter values:
- Add DefaultValue field to CppParameter (optional, null when absent)
- Parse default from ParmVarDecl inner nodes in ParseParameter
- Add ExtractDefaultValue helper handling integer/float/bool/string/nullptr
  literals, named constants (DeclRefExpr), unary operators, and implicit cast
  wrappers; returns null for complex expressions
- Include '= {defaultValue}' in BuildMethodSignature parameter list when set

Tests:
- Add DefaultParamFixtures.h fixture with crc32 (seed=0U default) and count_capped
- Add CppGenerator_Generate_DefaultParameter_SignatureContainsDefault
- Add CppGenerator_Generate_NoteTag_RenderedAsBlockquote

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

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 47 out of 47 changed files in this pull request and generated 2 comments.

Comment thread src/ApiMark.Cpp/CppGenerator.cs
Comment thread src/ApiMark.Cpp/CppGenerator.cs Outdated
Malcolm Nixon and others added 2 commits June 9, 2026 00:55
- Split CXXBoolLiteralExpr handling in ExtractDefaultValue to correctly
  read JSON boolean values (true/false) rather than calling GetString()
  which silently returns null
- Add float scale() fixture function to DefaultParamFixtures.h
- Add three tests covering all default value types:
  - BoolDefaultParameter: bool initial = false
  - NegativeIntDefaultParameter: int max = -1
  - FloatDefaultParameter: float factor = 1.5f
- Total: 62 C++ tests passing

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
- Namespace page 'Type Aliases' table now calls cppResolver.Linkify on
  the underlying type, enabling intra-library links and tracking external
  types for the page's External Types section
- WriteTypeAliasPage now accepts CppTypeLinkResolver, uses SimplifyTypeName
  on the underlying type in the using declaration (consistent with all
  other signatures in the generator), and emits an External Types section
- Add test CppGenerator_Generate_TypeAliasPage_SimplifiesUnderlyingType
  verifying that verbose clang basic_string forms are simplified to
  std::string on both the alias page and the namespace summary table

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

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 47 out of 47 changed files in this pull request and generated 2 comments.

Comment thread src/ApiMark.DotNet/TypeLinkResolver.cs Outdated
Comment thread src/ApiMark.Cpp/CppTypeLinkResolver.cs Outdated
Malcolm Nixon and others added 3 commits June 9, 2026 01:32
Parser:
- Extracted BuildClass (returns CppClass?) from ParseClass (now a thin
  wrapper), allowing recursive nested class parsing without leaking into
  the namespace builder
- Added CXXRecordDecl, ClassTemplateDecl, and TypeAliasDecl cases in
  BuildClass inner loop; only public members collected

Model:
- Added NestedClasses and TypeAliases to CppClass record

Generator:
- Added FlattenClass LINQ helper to build knownTypes entries for nested
  classes and their aliases using fully-qualified keys, preventing
  same-short-name collisions (e.g. Outer::size_type vs Other::size_type)
- Added WriteNestedTypePages recursive helper
- Extended WriteTypePage with Nested Classes and Type Aliases H2 sections

CppTypeLinkResolver:
- FindPageKey short-name fallback now returns null when multiple known
  types share the same unqualified name, preventing non-deterministic links

Tests:
- 5 new integration tests for nested class and class-scoped alias features
- 4 new CppTypeLinkResolver unit tests (exact match, unambiguous short-name,
  ambiguous short-name emits plain text, qualified reference to ambiguous type)
- New NestedClassFixtures.h fixture with Outer/Inner nesting and
  same-name size_type aliases on Outer and Other

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
DotNetGenerator:
- Add HasNullableAnnotation helper reading NullableAttribute(byte) and
  NullableAttribute(byte[]) from Mono.Cecil custom attribute providers
- Add IsMemberTypeNullableAnnotated dispatching to the correct attribute
  provider for each member kind (method return, property, field, event)
- Pass isNullableAnnotated to all three type-table Linkify call sites and
  to BuildMethodSignature, BuildPropertySignature, BuildFieldSignature,
  and BuildEventSignature so that string[]?, string?, etc. are correctly
  rendered throughout generated output

TypeLinkResolver:
- Propagate isNullableAnnotated through the ArrayType branch so that
  string[]? renders as string[]? rather than string[]

ArrayAndNullableClass fixture:
- Add GetNullableNames() returning string[]? to exercise the nullable
  array annotation path end-to-end

Tests:
- Add DotNetGenerator_Generate_NullableArrayReturnType_RendersWithQuestionMark
  verifying string[]? in both the type page Methods table and detail page signature

reqstream:
- Correct ShowDeletedFunctionsWithDeletedNotation test references to match
  actual test method names (EmitsDeleteSuffix not SignatureContainsDeleteSuffix)

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

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

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 50 out of 50 changed files in this pull request and generated 4 comments.

Comment thread docs/verification/api-mark-cpp.md Outdated
Comment thread docs/verification/api-mark-cpp.md Outdated
Comment thread docs/design/ots/clang.md Outdated
Comment thread docs/design/api-mark-msbuild/api-mark-task.md Outdated
- Correct test names in api-mark-cpp.md verification doc: use
  CppGenerator_Generate_DeletedCopyConstructor_EmitsDeleteSuffix and
  CppGenerator_Generate_DeletedCopyAssignmentOperator_EmitsDeleteSuffix,
  and update scenario descriptions to say 'copy constructor' and
  'copy-assignment operator'
- Replace stale IncludePatterns/ExcludePatterns reference in clang.md
  with ApiHeaderPatterns
- Add APIMARK_CLANG_PATH env var to clang discovery order in
  api-mark-task.md

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
@Malcolmnixon
Malcolmnixon merged commit 5dc5d6a into main Jun 9, 2026
15 checks passed
@Malcolmnixon
Malcolmnixon deleted the inhertitance-info branch June 9, 2026 06:20
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