Skip to content

[3.0] Add generator docs#2578

Draft
Exanite wants to merge 95 commits into
develop/3.0from
feature/generator-docs
Draft

[3.0] Add generator docs#2578
Exanite wants to merge 95 commits into
develop/3.0from
feature/generator-docs

Conversation

@Exanite

@Exanite Exanite commented May 11, 2026

Copy link
Copy Markdown
Member

Summary of the PR

This replaces my previous WIP PR for adding generator usage documentation (#2545) in favor of providing a more complete set of docs relating to both using the generator and how the generator internals work.

Related issues, Discord discussions, or proposals

Related discord thread: https://discord.com/channels/521092042781229087/1500974857079492749

  • Currently not much to see here since all my thoughts have been put into the docs instead.

Further Comments

There are sections that I left empty (marked with TODOs) since I don't have enough knowledge to fill out those sections.

Tasks

  • Write the generator docs
    • Using the Generator
    • Naming Pipeline
    • Generator Mods
  • Ensure examples have matching unit tests
  • Update unit tests to use new document verification utility
  • Fix or add tasks (see my tracking issue) for the following issues identified while writing the docs:
    • ExtractNestedTyping constant extraction does not handle nor rewrite fields that are typed as a predefined type, but are natively typed as an enum (test case: SuccessfullyExtractsCStyleEnumConstants_Field)
    • ExtractNestedTyping constant extraction does not handle nor rewrite return types that are typed as a predefined type, but are natively typed as an enum (test case: SuccessfullyExtractsCStyleEnumConstants_ReturnType)
    • ExtractNestedTyping does not annotate extracted enums with the [NativeName] attribute. Eg: SDL_BlendMode.
    • Consider making it so that handle types implement the IEquatable<T> interface.
    • These are fixed by [3.0] Split up ExtractNestedTyping and add tests for TransformHandles #2587

From my tracking issue:

@Exanite Exanite left a comment

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

Self review completed. I didn't deeply review the docs I wrote, but I skimmed through each of them a couple of times. My goal is to get the information out there first, then refine the docs in the future. There's also a few sections I left as TODOs because I don't have enough knowledge to fill them out.

/// <list type="bullet">
/// <item><description>
/// Replacing function pointers identified by their <see cref="NativeTypeNameAttribute"/>s with delegates and
/// <c>Pfn</c>-prefixed structures.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

I changed this since these aren't actually Pfn-prefixed and simply use the native name of the function pointer type.

@Exanite

Exanite commented Jun 10, 2026

Copy link
Copy Markdown
Member Author

I'll mark this PR as ready for review once #2587 has been merged.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: Todo

Development

Successfully merging this pull request may close these issues.

1 participant