Skip to content

core: expose findTableRanges and isPotentialSeparatorLine (11.2.0) - #32

Merged
krotname merged 1 commit into
masterfrom
feature/core-parity-11.2.0
Sep 6, 2026
Merged

core: expose findTableRanges and isPotentialSeparatorLine (11.2.0)#32
krotname merged 1 commit into
masterfrom
feature/core-parity-11.2.0

Conversation

@krotname

@krotname krotname commented Sep 6, 2026

Copy link
Copy Markdown
Owner

Brings the Notepad++ core up to the same public surface as the JetBrains (Java) and VS Code (TypeScript) cores, and makes the shared golden fixture cover the newly common entry points.

Core

  • isPotentialSeparatorLine(line) and findTableRanges(lines) are now public, matching the other two cores.
  • findTableRange was refactored onto the shared tableRangeWithSeparatorAt / nextSeparatorCandidate helpers instead of inlining the header/separator pairing, so one scan rule serves every caller and discovered ranges still cannot overlap.
  • No behaviour of the existing API changed.

Shared fixture

test-fixtures/markdown-table-core-golden.json gains separatorLines (15 scenarios) and ranges (9 scenarios) and moves to schemaVersion 2. The same file, with the same expectations, lands in all three repositories, and each repository's golden runner now executes both sections.

Evidence

A cross-core corpus harness ran 51 629 generated scenarios (every action at many caret positions, applyWrappedToWidth at 12 widths, CSV/TSV conversion, table creation, range lookup, range enumeration, separator detection and cursor-to-column mapping) through the Java, C++ and TypeScript cores. All three reports - 234 504 lines covering ok, changed, message, caret row/column/offset and every produced line, with offsets normalised to UTF-8 bytes - are byte-identical (SHA-256 5C700A32...). Two mutation controls confirm the harness is sensitive: changing the hard wrap width by one produced 400 differing lines, and weakening the range-scan resume rule produced 322 064.

Local gates: RunCoreSmokeTests (85 scenario + 156 golden checks), RunPluginShortcutSmokeTests, Coverage (93.76%, gate 70%) and CorePerformance all pass.

The JetBrains and VS Code cores already offered both entry points, while the C++
core inlined the same rules inside findTableRange. The Notepad++ edition could
therefore neither enumerate every table in a document nor ask whether a single
line is a separator, so the three cores' public surfaces were not the same.

findTableRange now shares tableRangeWithSeparatorAt and nextSeparatorCandidate
with the two new public functions, so one scan rule serves every caller and
discovered ranges still cannot overlap.

The shared golden fixture gains separatorLines and ranges sections and moves to
schemaVersion 2; the fixture runner executes both, which is what keeps the three
implementations checked against the same expectations. Version.props moves to
11.2.0.
@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Sep 6, 2026

Copy link
Copy Markdown

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
🔒 Security Review Completed 2026-09-06T05:13:21.239336Z 6c9d97b PR opened
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@codecov

codecov Bot commented Sep 6, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.

📢 Thoughts on this report? Let us know!

@krotname
krotname merged commit 986838e into master Sep 6, 2026
19 checks passed
@krotname
krotname deleted the feature/core-parity-11.2.0 branch September 6, 2026 05:17
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