Repository navigation
Apply V4A edits that only delete a blank line - #112
Draft
Conversation
Joining matched lines with a newline cannot tell an empty replacement from one blank line, so a deletion of that line was dropped as a no-op. Compare the replacement with str::lines so the deletion is applied.
Author
|
This PR was generated with Warp. Comment |
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.


Description
A V4A edit that only deletes one blank line is no longer dropped as a no-op. Joining the matched lines with a newline turns that blank line into an empty string, which matched the empty replacement. The comparison now uses
str::lines, so the deletion is applied. Adding a blank line was already applied once the server sent it as a trailing newline.Companion server change: https://github.com/warpdotdev/warp-server-for-benchmarks/pull/4226
Linked Issue
ready-to-specorready-to-implement.Server tracking: REMOTE-1.
Testing
cargo test -p ai --lib diff_validation::tests::test_v4acargo clippy -p ai --lib --tests -- -D warnings./script/runThis is not a rendered UI change. The new unit tests cover deleting one blank line, adding one blank line, and a blank line replaced by a blank line.
Screenshots / Videos
Not applicable: the change is in diff matching, not a visible surface.
Agent Mode
CHANGELOG-BUG-FIX: Agent file edits that only delete a blank line are applied instead of being ignored.