Skip to content

Fix \usage truncation for long (>20-line) function signatures#14

Merged
TroyHernandez merged 2 commits into
mainfrom
fix-long-signature-parse
Jun 6, 2026
Merged

Fix \usage truncation for long (>20-line) function signatures#14
TroyHernandez merged 2 commits into
mainfrom
fix-long-signature-parse

Conversation

@TroyHernandez

Copy link
Copy Markdown
Contributor

parse_file() looked ahead a fixed 20 lines to capture a function's signature, so any function whose formals span more than ~20 lines was truncated mid-argument. The partial text failed to parse and fell back to names-without-defaults, yielding an incomplete \usage{} and R CMD check codoc mismatches (hit while migrating tinyspotifyr, whose get_recommendations has 49 args).

Fix: read forward until the signature's parentheses balance instead of a fixed window (one-liners stop after their first line). Adds a regression test for a 30-arg multi-line signature. Full suite: 148 pass.

parse_file() captured only a fixed 20-line window after a definition, so a
function whose signature spans more lines (e.g. a 49-arg signature) was cut
mid-list, failed to parse, and fell back to names-without-defaults -- producing
an incomplete \usage and R CMD check codoc mismatches. Read until the
signature parentheses balance instead. Adds a regression test.
@TroyHernandez TroyHernandez merged commit 7095eb6 into main Jun 6, 2026
4 checks passed
@TroyHernandez TroyHernandez deleted the fix-long-signature-parse branch June 6, 2026 22:51
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.

1 participant