Skip to content

check --fix: subsection boundary and multi-table edge cases in the code-aware table scanner #768

Description

@0xLeif

Follow-ups from Codex review of #766 (table_rows_outside_code in src/commands/check.rs), deferred because that package was already finalized. None affects the common case fixed by #766; all are worth a drill and a fix in 6.0.x.

  1. Two genuine tables in one export subsection. table_column_count takes the first table's width while table_rows_end picks the last table for insertion. If a ### Exported Functions subsection holds the export table followed by, say, a parameters table, the generated row lands in the second table with the first table's column count. Fix: identify one contiguous target table and derive both width and insertion offset from it (prefer the first table whose header names a Name column).
  2. Indented literal fence marker. A four-space-indented line such as ```` is content under CommonMark, but the scanner records it as a fence opener before the indentation check, so a later real table is treated as still fenced and--fix` falls back to the section end. Fix: check indentation before updating fence state.
  3. Fenced heading before the table. sub_positions (subsection boundary discovery) is fence-blind: a ### Example line inside a fenced sample before the real export table ends the subsection early, table_rows_end returns None for that block, and the fallback inserts the row before the fenced heading, inside the fence. Fix: make the ### scan skip fenced code the same way the row scanner does.

Each should get a regression test in tests/integration/fix.rs alongside the #766 tests.

Activity

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    area:test-coverageTests, verification, coverage, or lint coverage gaparea:uxMessages, output, or next actions mislead or frustrateimpact:developer-experienceAffects authors, maintainers, or local workflowspriority:p2Important but not immediately release-blockingresolution:partialRelated work landed but meaningful residual work remainsscope:specsync-6Applies to current SpecSync 6 behavior or release contract

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions