Skip to content

Conversation

@bramburn
Copy link
Contributor

@bramburn bramburn commented May 9, 2025

The key improvement is that we now apply each search/replace block sequentially, updating the content after each application. This ensures that each subsequent block operates on the most up-to-date content, which preserves indentation and prevents the issues that were occurring when all blocks were applied to the original content in a batch. The implementation:
Parses all search/replace blocks from the diff content Sorts them by start line to apply them in order
Applies each block sequentially using the applySingleDiffBlock method Updates the content and line number delta after each block is applied Returns the final content with all blocks applied

Related GitHub Issue

Closes: #

Description

Test Procedure

Type of Change

  • 🐛 Bug Fix: Non-breaking change that fixes an issue.
  • New Feature: Non-breaking change that adds functionality.
  • 💥 Breaking Change: Fix or feature that would cause existing functionality to not work as expected.
  • ♻️ Refactor: Code change that neither fixes a bug nor adds a feature.
  • 💅 Style: Changes that do not affect the meaning of the code (white-space, formatting, etc.).
  • 📚 Documentation: Updates to documentation files.
  • ⚙️ Build/CI: Changes to the build process or CI configuration.
  • 🧹 Chore: Other changes that don't modify src or test files.

Pre-Submission Checklist

  • Issue Linked: This PR is linked to an approved GitHub Issue (see "Related GitHub Issue" above).
  • Scope: My changes are focused on the linked issue (one major feature/fix per PR).
  • Self-Review: I have performed a thorough self-review of my code.
  • Code Quality:
    • My code adheres to the project's style guidelines.
    • There are no new linting errors or warnings (npm run lint).
    • All debug code (e.g., console.log) has been removed.
  • Testing:
    • New and/or updated tests have been added to cover my changes.
    • All tests pass locally (npm test).
    • The application builds successfully with my changes.
  • Branch Hygiene: My branch is up-to-date (rebased) with the main branch.
  • Documentation Impact: I have considered if my changes require documentation updates (see "Documentation Updates" section below).
  • Changeset: A changeset has been created using npm run changeset if this PR includes user-facing changes or dependency updates.
  • Contribution Guidelines: I have read and agree to the Contributor Guidelines.

Screenshots / Videos

Documentation Updates

Additional Notes

The key improvement is that we now apply each search/replace block sequentially, updating the content after each application. This ensures that each subsequent block operates on the most up-to-date content, which preserves indentation and prevents the issues that were occurring when all blocks were applied to the original content in a batch.
The implementation:
Parses all search/replace blocks from the diff content
Sorts them by start line to apply them in order
Applies each block sequentially using the applySingleDiffBlock method
Updates the content and line number delta after each block is applied
Returns the final content with all blocks applied
@changeset-bot
Copy link

changeset-bot bot commented May 9, 2025

⚠️ No Changeset found

Latest commit: 0307978

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

This PR includes no changesets

When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR

@hannesrudolph
Copy link
Collaborator

@bramburn what isue does this close?

@hannesrudolph hannesrudolph moved this from New to PR [Draft/WIP] in Roo Code Roadmap May 10, 2025
@bramburn
Copy link
Contributor Author

bramburn commented May 10, 2025 via email

@hannesrudolph
Copy link
Collaborator

@bramburn are you going to be pushing this past the finish line this week?

@hannesrudolph hannesrudolph moved this from New to PR [Draft/WIP] in Roo Code Roadmap May 20, 2025
@hannesrudolph hannesrudolph moved this from PR [Draft / In Progress] to TEMP in Roo Code Roadmap May 26, 2025
@daniel-lxs
Copy link
Member

Hey @bramburn,
Thank you for your contribution, We noticed this PR is stale and will be closed. If you plan to revisit this, please leave a comment on #1559 to have it assigned to you again.

@daniel-lxs daniel-lxs closed this May 26, 2025
@github-project-automation github-project-automation bot moved this from PR [Draft/WIP] to Done in Roo Code Roadmap May 26, 2025
@github-project-automation github-project-automation bot moved this from TEMP to Done in Roo Code Roadmap May 26, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Archived in project

Development

Successfully merging this pull request may close these issues.

3 participants