Skip to content

docs: fill every stdlib doc-comment gap, fix std explorer's mixed text - #212

Merged
omdxp merged 5 commits into
mainfrom
stdlib-doc-comments
Oct 21, 2026
Merged

omdxp merged 5 commits into
mainfrom
stdlib-doc-comments

Conversation

@omdxp

@omdxp omdxp commented Oct 21, 2026 •

Copy link
Copy Markdown
Owner

Summary

  • Fixed the std explorer's doc-comment extraction (website/reference/scripts/generate-content.mjs): it walked through blank lines once it had seen a comment, gluing an unrelated floating banner a few lines above onto a symbol's own doc text. Now strict, matching fls's own doc_comment_above exactly (stop at the first blank line) - fixes 11 confirmed cases of mixed/garbled text in the current site.
  • Fixed the same bug shape in the module-level top-comment extractor, scanning downward from the file's top instead of upward: it absorbed the first declared symbol's own doc comment into the module-level text (confirmed on std.c.atomic.fn).
  • Added a doc comment to every stdlib public symbol that was missing one: functions, compounds, enums (and every variant), shapes (and every member), impl methods, and fields - across every file in stdlib/std/ including stdlib/std/c/. Verified against the real generator's own output, not an approximation: zero gaps left.
  • Added a "View source" link alongside the existing "Copy link"/"Permalink" buttons, everywhere a line number already shows (module header, active symbol, every field/member/variant) - points straight at the real GitHub line, pinned to the v{funVersion} release tag the generated content was built from.

Test plan

  • fun -fmt-check-all clean
  • fun build (full project) clean
  • Re-ran the content generator after every change; scripted a full scan of its own output (every symbol, field, variant, and shape/impl member across all 66 generated modules) confirming zero undocumented entries remain
  • Spot-checked several of the previously-mixed-text cases (math.fn's sin_dec, shapes.fn's Sized, error.fn's ErrorKind, std.c.atomic.fn's module doc) directly in the regenerated JSON to confirm no more bleed
  • npx tsc --noEmit and npm run build:web both clean
  • Ran the dev server locally and clicked through the new View source links
  • Pure comment-only change to .fn files (no logic touched) - no test-suite run needed per this repo's own convention for comment-only diffs

omdxp added 2 commits October 21, 2026 12:36
It kept walking through blank lines once it had seen one comment, gluing an unrelated floating banner a few lines above onto a symbol's own doc text - confirmed as 11 real mixed-text cases in the current site. Now stops at the first blank line, matching fls's own doc_comment_above exactly.
Every pub fun/compound/enum/shape, every field, variant, and shape/impl method across stdlib/std now has its own doc comment - confirmed zero gaps left by the real generator's own scan, not an approximation.
@codecov

codecov Bot commented Oct 21, 2026 •

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 81.60%. Comparing base (23fe550) to head (57e64e5).

Additional details and impacted files
@@           Coverage Diff           @@
##             main     #212   +/-   ##
=======================================
  Coverage   81.59%   81.60%           
=======================================
  Files         102      102           
  Lines       41387    41387           
=======================================
+ Hits        33771    33774    +3     
+ Misses       7616     7613    -3     

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

omdxp added 3 commits October 21, 2026 12:44
…wn doc

Same bug shape as collectCommentAbove, just scanning downward from the file's top instead of upward from a declaration - confirmed on std.c.atomic.fn, whose module doc ran straight into __fun_atomic_load's own comment. A genuine blank line only ever ends a module comment in this codebase (a paragraph break inside one is always a bare //), so there's no legitimate case the old leniency covered.
…link

Points straight at the real GitHub line, pinned to the v{funVersion} release tag the generated content itself was built from (same convention the existing release-notes link already uses) - so it stays accurate for whichever version a given page is showing, not main, which drifts. Added next to the module header, the active symbol's own header, and every field/member/variant row - everywhere a line number already shows.
position: sticky on the symbol/module tabs hit a genuine WebKit repaint bug - stale content from whatever had scrolled past stayed visible behind them (Chromium was clean at the exact same scroll state, confirmed directly, a translateZ(0) compositing workaround did not fix it either). Restructured so the tabs sit structurally outside the scrolling area instead, the same way the modal header already safely does, removing the sticky positioning entirely rather than chasing the repaint quirk further.

Also normalizes the Copy link/View source/Permalink/Close buttons (mixing <a> and <button> under the same class left the anchor taller - no shared display/line-height/font to make them agree) and left-aligns a symbol's own line/View source row under its heading instead of cramming it inline.
@omdxp
omdxp merged commit ab27b09 into main Oct 21, 2026
6 checks passed
@omdxp
omdxp deleted the stdlib-doc-comments branch October 21, 2026 11:10
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