core: expose findTableRanges and isPotentialSeparatorLine (11.2.0) - #32
Merged
Conversation
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.
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
Codecov Report✅ All modified and coverable lines are covered by tests. 📢 Thoughts on this report? Let us know! |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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)andfindTableRanges(lines)are now public, matching the other two cores.findTableRangewas refactored onto the sharedtableRangeWithSeparatorAt/nextSeparatorCandidatehelpers instead of inlining the header/separator pairing, so one scan rule serves every caller and discovered ranges still cannot overlap.Shared fixture
test-fixtures/markdown-table-core-golden.jsongainsseparatorLines(15 scenarios) andranges(9 scenarios) and moves toschemaVersion2. 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,
applyWrappedToWidthat 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 coveringok,changed,message, caret row/column/offset and every produced line, with offsets normalised to UTF-8 bytes - are byte-identical (SHA-2565C700A32...). 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%) andCorePerformanceall pass.