Skip to content

Conversation

@fede-ciliberti
Copy link

@fede-ciliberti fede-ciliberti commented May 6, 2025

This pull request introduces several updates to the multi-search-replace strategy in src/core/diff/strategies/multi-search-replace.ts. Key changes include the addition of a weighted threshold for fuzzy matching, improvements to error reporting, and enhanced documentation for the diff format. These updates aim to make the fuzzy search more adaptive, improve error clarity, and ensure proper usage of the diff format.

Enhancements to Fuzzy Matching:

  • Added a new getWeightedThreshold function to dynamically adjust the fuzzy match threshold based on the text length, ensuring better adaptability for varying content sizes.
  • Updated fuzzy matching logic to use the weighted threshold instead of a static threshold, improving the accuracy of match detection. [1] [2]

Improvements to Error Reporting:

  • Enhanced error messages to include the dynamically calculated weighted threshold, providing more context for debugging insufficient similarity matches.

Documentation and Formatting Updates:

  • Expanded the diff format documentation with detailed rules, examples, and common errors to avoid, ensuring users adhere to the correct format. [1] [2] [3] [4]
  • Refactored regex patterns for parsing diff content into a more modular and readable structure, improving maintainability.

Minor Adjustments:

  • Normalized the searchChunk input by removing trailing newlines to prevent mismatches during fuzzy search.

Important

Add weighted threshold for fuzzy matching in multi-search-replace.ts, enhance error reporting, and expand diff format documentation.

  • Fuzzy Matching:
    • Add getWeightedThreshold function in multi-search-replace.ts to adjust threshold based on text length.
    • Update fuzzy matching logic to use weighted threshold, improving match accuracy.
  • Error Reporting:
    • Enhance error messages to include weighted threshold for better debugging.
  • Documentation:
    • Expand diff format documentation with rules, examples, and common errors.
    • Refactor regex patterns for parsing diff content for readability.
  • Misc:
    • Normalize searchChunk input by removing trailing newlines in fuzzySearch().

This description was created by Ellipsis for 8df5d92. You can customize this summary. It will automatically update as commits are pushed.

@changeset-bot
Copy link

changeset-bot bot commented May 6, 2025

⚠️ No Changeset found

Latest commit: 8b48d49

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

@dosubot dosubot bot added size:L This PR changes 100-499 lines, ignoring generated files. enhancement New feature or request labels May 6, 2025
fede-ciliberti and others added 4 commits May 6, 2025 12:10
Co-authored-by: ellipsis-dev[bot] <65095814+ellipsis-dev[bot]@users.noreply.github.com>
Co-authored-by: ellipsis-dev[bot] <65095814+ellipsis-dev[bot]@users.noreply.github.com>
…ance getWeightedThreshold logic and add tests
@hannesrudolph hannesrudolph moved this from New to PR [Pre Approval Review] in Roo Code Roadmap May 7, 2025
@dosubot dosubot bot added size:XXL This PR changes 1000+ lines, ignoring generated files. and removed size:L This PR changes 100-499 lines, ignoring generated files. labels May 8, 2025
@dosubot dosubot bot added size:XL This PR changes 500-999 lines, ignoring generated files. and removed size:XXL This PR changes 1000+ lines, ignoring generated files. labels May 10, 2025
@hannesrudolph hannesrudolph moved this from New to PR [Pre Approval Review] in Roo Code Roadmap May 20, 2025
@hannesrudolph hannesrudolph moved this from PR [Needs Review] to TEMP in Roo Code Roadmap May 26, 2025
@daniel-lxs daniel-lxs moved this from TEMP to PR [Needs Review] in Roo Code Roadmap May 27, 2025
@daniel-lxs
Copy link
Member

Hey @fede-ciliberti, we apologive for taking so long to review your PR.

We recently added a test for the multi search replace tool on #2220.

Do you think it is a good idea to use this to test your implementation?

Let me know what you think.

@daniel-lxs daniel-lxs moved this from PR [Needs Prelim Review] to PR [Changes Requested] in Roo Code Roadmap Jun 4, 2025
@hannesrudolph
Copy link
Collaborator

Stale

@github-project-automation github-project-automation bot moved this from PR [Changes Requested] to Done in Roo Code Roadmap Jun 16, 2025
@github-project-automation github-project-automation bot moved this from PR [Pre Approval Review] to Done in Roo Code Roadmap Jun 16, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request PR - Changes Requested size:XL This PR changes 500-999 lines, ignoring generated files.

Projects

Archived in project

Development

Successfully merging this pull request may close these issues.

3 participants