assistant edit tool: Replace with flexible indentation (#27039)

Sometimes the model produces SEARCH queries that don't match the
indentation of the source file exactly.

When we can't find an exact match, we'll now attempt to match the lines
while being more flexible about the leading whitespace as long as all
lines are consistently offset from the source, and extend the leading
whitespace in the REPLACE string accordingly.

Release Notes:

- N/A
This commit is contained in:
Agus Zubiaga 2025-03-19 09:39:00 -03:00 committed by GitHub
parent 9377ef9817
commit 1d33bfde37
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
4 changed files with 539 additions and 34 deletions

View file

@ -43,3 +43,4 @@ language = { workspace = true, features = ["test-support"] }
project = { workspace = true, features = ["test-support"] }
rand.workspace = true
workspace = { workspace = true, features = ["test-support"] }
unindent.workspace = true