fix: apply patching fixes#176
Merged
DecimalTurn merged 10 commits intolatestfrom May 5, 2026
Merged
Conversation
There was a problem hiding this comment.
Pull request overview
This PR improves TOML patching correctness for structurally tricky documents, specifically around (1) replacing a table section with a scalar value and (2) resolving paths under array-of-tables (AOT), including nested AOT cases.
Changes:
- Extend patch application to use a JS snapshot (
updated_js) for regenerating correct AST nodes in edge cases (table→scalar replacement, AOT regeneration). - Enhance
findByPathto resolve nodes inside an AOT entry’s logical scope (covering nested AOT + sub-tables stored as Document siblings). - Add a comprehensive spec-fixture-based regression test suite for patching.
Reviewed changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated 4 comments.
| File | Description |
|---|---|
| src/patch.ts | Adds special-case patching logic for AOT regeneration and table→scalar replacement using updated_js. |
| src/find-by-path.ts | Adds scoped AOT path resolution logic so patch operations can locate nested AOT/sub-table nodes correctly. |
| src/tests/patch.spec-example.test.ts | Adds regression coverage against the TOML spec example fixture for tricky patching scenarios. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
8b93e35 to
9b4148b
Compare
This reverts commit cfad091.
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.
Uh oh!
There was an error while loading. Please reload this page.