Skip to content

refactor: one declaration renderer, one member partial, one vocabulary - #132

Merged
auscaster merged 6 commits into
mainfrom
refactor/core-shape
Sep 1, 2026
Merged

refactor: one declaration renderer, one member partial, one vocabulary#132
auscaster merged 6 commits into
mainfrom
refactor/core-shape

Conversation

@auscaster

Copy link
Copy Markdown
Member

Core structure work behind #130 and #131, with a regression guard built first.

The guard

test/snapshots/ holds the full rendered Markdown for all 11 fixtures plus the search entries generate() returns and run() never writes to disk. The other suites assert on chosen lines, so anything outside them landed silently. I proved it fails on a one-word label change before relying on it, and every commit below was judged against it.

One declaration renderer

member.proto was 116 lines of parser code duplicating the signature helper, feeding one search-snippet fallback, kept "for classic templates" — a directory the docs tell users to pass and which is not in this repo. compound.proto was written and never read. Both gone; src/signature.ts is now the only thing that knows what a declaration looks like. Net 207 lines deleted.

One visible effect: the macro search snippet was \define ``GGROUP_DEFINE`, now #define GGROUP_DEFINE 1`.

Function pointers (fixes #131)

Parameters came from a hardcoded list of member kinds. Doxygen reports a function pointer as a variable with no <param> elements at all, describing its arguments only in a <parameterlist>, so they fell through and nothing rendered. Parameters now come from whatever evidence exists. And since Doxygen splits int (*retry)(int n) into type, name and argsstring, joining those three restores the declaration without parsing C.

One member partial

The six member sections were near-copies. Measured: 92 lines (cpp/class), 60, 50, and only cpp/class carried source links and relation lists — java/class did not, which settled whether the divergence was design or drift.

They now share one partial per language. Namespace, group and index pages gain the source links and separators; enum tables sit in the same position everywhere. Full blast radius across the corpus: 12 Defined in lines, 13 separators, and the enum table moving.

Member types link (#130)

A member's own section now echoes its type as a link, so a struct member pointing at another type can be followed. Only where the type points somewhere, and only for members that are not callable, since functions already link their types in the parameter and summary tables.

The all-members table now appears only where members are actually inherited. MountainBike keeps it and shows PedalHarder inherited from Bicycle; Bicycle and the ten fixture classes with no bases lose a table that repeated the one below it with less in it.

One vocabulary

SECTION_LABELS, searchCategoryForKind and the return-column set lived in three modules with define → Macros written twice. Now co-located in src/vocabulary.ts. They do not collapse into one table, since kind and section are different axes, so this is adjacency rather than unification.

Bundles the 2.1.17 bump.

Member sections were six near-copies. They now share one partial per
language, which also gives namespace, group and index pages the source
links and separators only cpp/class had.

Member types link to their definition, and the all-members table appears
only where members are actually inherited.
@auscaster
auscaster merged commit 60039c4 into main Sep 1, 2026
3 checks passed
@auscaster
auscaster deleted the refactor/core-shape branch September 1, 2026 02:37
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.

Display documentation about the arguments of a function pointer

1 participant