fix: zero fix --apply writes combined-source buffer to original file#21
Open
mkitsugi wants to merge 1 commit into
Open
fix: zero fix --apply writes combined-source buffer to original file#21mkitsugi wants to merge 1 commit into
mkitsugi wants to merge 1 commit into
Conversation
|
@mkitsugi is attempting to deploy a commit to the Vercel Labs Team on Vercel. A member of the Team first needs to authorize it. |
print_or_apply_fix_json was scanning and writing input->source, the import-resolved combined buffer that fs.c::append_source_without_imports prefixes each file with `// file: <path>`. For --apply this injected the prefix as the first line of the user's file; for --patch it shifted line numbers by one. Re-read input->source_file from disk before applying the line edit. The conformance assertion for --apply was a regex match (/let mut dst/) which the injected header passed through; tightened to full-content equality, and added an explicit patches[0].line check for --patch.
1cbca6f to
bb618ce
Compare
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.
print_or_apply_fix_json was scanning and writing
input->source— the import-resolved combined buffer thatfs.c::append_source_without_importsprefixes each file with// file: <path>. For--applythis injected the prefix as the first line of the user's file; for--patchit shifted reported line numbers by one. Re-readinput->source_filefrom disk before applying the line edit.Repro on the existing fixture:
The conformance assertion for
--applywas a regex match (/let mut dst/) which the injected header passed through; tightened to full-content equality, and added an explicitpatches[0].linecheck for--patch.