fix: attach doc comments to same-line logos_events/access-specifier decls

Address review feedback: the first pass cleared pendingDoc on every
specifier match, so a `///` comment above a collapsed
`logos_events : void foo();` did not attach to the event. In the collapsed
form there is nowhere else to put the doc comment, so this left
documentation formatting-dependent — the same bug class as #76, one level up.

Only clear pendingDoc for a *bare* specifier (a section boundary, matching
Qt `signals:` semantics); when a declaration shares the line, keep the
pending doc so the declaration parser attaches it.

Extend the fixture with a `///`-documented same-line event and assert the
description is captured.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This commit is contained in:
Dario Gabriel Lipicar
2026-06-09 14:33:21 -03:00
co-authored by Claude Opus 4.8
parent e2f28b9245
commit 5231663a33
3 changed files with 22 additions and 3 deletions
@@ -386,6 +386,10 @@ TEST_F(ImplHeaderParserTest, SameLineSectionSpecifiers)
ASSERT_EQ(versionReady->params.size(), 1);
EXPECT_EQ(versionReady->params[0].name, "version");
EXPECT_EQ(versionReady->params[0].type.name, "tstr");
// The `///` doc comment above the collapsed line must attach: in the
// same-line form there is nowhere else for it to go, so documentation
// must not be formatting-dependent either.
EXPECT_EQ(versionReady->description, "Fired once the latest version is known.");
// An event declared after the section is already open, also same-line.
const EventDecl* downloadProgress = findEvent("downloadProgress");