Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 2 additions & 3 deletions crates/forge_services/src/tools/patch/apply.rs
Original file line number Diff line number Diff line change
Expand Up @@ -192,9 +192,8 @@ impl<T: Infrastructure> ExecutableTool for ApplyPatch<T> {
)
} else {
format!(
"<file_content path=\"{}\">\n{}\n</file_content>\n",
input.path,
modified.trim_end()
"<file_content\n path=\"{}\" status=\"patched_successfully\" />\n",
input.path
)
};
anyhow::Ok(output)
Expand Down
5 changes: 2 additions & 3 deletions crates/forge_services/src/tools/patch/apply_json.rs
Original file line number Diff line number Diff line change
Expand Up @@ -236,9 +236,8 @@ fn format_output(path: &str, content: &str, warning: Option<&str>) -> String {
)
} else {
format!(
"<file_content path=\"{}\">\n{}\n</file_content>\n",
path,
content.trim_end()
"<file_content\n path=\"{}\" status=\"patched_successfully\" />\n",
path
)
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,22 +2,5 @@
source: crates/forge_services/src/tools/patch/apply.rs
expression: "TempDir::normalize(&result)"
---
<file_content path="[TEMP_DIR]/test.txt">


// Header comment


function test() {
// Inside comment

let y = 2;


console.log(y);
}



// Updated footer
</file_content>
<file_content
path="[TEMP_DIR]/test.txt" status="patched_successfully" />
Original file line number Diff line number Diff line change
Expand Up @@ -2,24 +2,5 @@
source: crates/forge_services/src/tools/patch/apply.rs
expression: "TempDir::normalize(&result)"
---
<file_content path="[TEMP_DIR]/test.txt">



// New header



function test() {
// Inside comment

let y = 2;


console.log(y);
}



// Updated footer
</file_content>
<file_content
path="[TEMP_DIR]/test.txt" status="patched_successfully" />
Original file line number Diff line number Diff line change
Expand Up @@ -2,20 +2,5 @@
source: crates/forge_services/src/tools/patch/apply.rs
expression: "TempDir::normalize(&result)"
---
<file_content path="[TEMP_DIR]/test.txt">


// Header comment


function test() {
// Inside comment

let y = 2;


console.log(y);
}

// Footer comment
</file_content>
<file_content
path="[TEMP_DIR]/test.txt" status="patched_successfully" />
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,5 @@
source: crates/forge_services/src/tools/patch/apply.rs
expression: "TempDir::normalize(&result)"
---
<file_content path="[TEMP_DIR]/test.txt">
First Line
Last Line
</file_content>
<file_content
path="[TEMP_DIR]/test.txt" status="patched_successfully" />
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,5 @@
source: crates/forge_services/src/tools/patch/apply.rs
expression: "TempDir::normalize(&result)"
---
<file_content path="[TEMP_DIR]/test.txt">
New content
</file_content>
<file_content
path="[TEMP_DIR]/test.txt" status="patched_successfully" />
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,5 @@
source: crates/forge_services/src/tools/patch/apply.rs
expression: "TempDir::normalize(&result)"
---
<file_content path="[TEMP_DIR]/test.txt">
class UserManager {
async findUser(id, options = {}) {
const user = await this.db.findOne({ userId: id, ...options });
if (!user) {
throw new UserNotFoundError(id);
}
return this.sanitizeUser(user);
}
}
</file_content>
<file_content
path="[TEMP_DIR]/test.txt" status="patched_successfully" />
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,5 @@
source: crates/forge_services/src/tools/patch/apply.rs
expression: "TempDir::normalize(&result)"
---
<file_content path="[TEMP_DIR]/test.txt">
class UserManager {
async findUser(id, options = {}) {
const user = await this.db.findOne({ userId: id, ...options });
if (!user) throw new Error('User not found');
return user;
}
}
</file_content>
<file_content
path="[TEMP_DIR]/test.txt" status="patched_successfully" />
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,5 @@
source: crates/forge_services/src/tools/patch/apply.rs
expression: "TempDir::normalize(&result)"
---
<file_content path="[TEMP_DIR]/test.txt">
function computeTotal(items, tax = 0) {
let total = 0.0;
for (const item of items) {
total += item.price * item.quantity;
}
return total;
}
</file_content>
<file_content
path="[TEMP_DIR]/test.txt" status="patched_successfully" />
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,5 @@
source: crates/forge_services/src/tools/patch/apply.rs
expression: "TempDir::normalize(&result)"
---
<file_content path="[TEMP_DIR]/test.txt">
function calculateTotal(items) {
let total = 0;
for (const item of items) {
total += item.price * item.quantity;
}
return total;
}
</file_content>
<file_content
path="[TEMP_DIR]/test.txt" status="patched_successfully" />
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,5 @@
source: crates/forge_services/src/tools/patch/apply.rs
expression: "TempDir::normalize(&result)"
---
<file_content path="[TEMP_DIR]/test.txt">
New First
Middle Line
New Last
</file_content>
<file_content
path="[TEMP_DIR]/test.txt" status="patched_successfully" />
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,5 @@
source: crates/forge_services/src/tools/patch/apply.rs
expression: "TempDir::normalize(&result)"
---
<file_content path="[TEMP_DIR]/test.rs">
fn main() { let x = 42; let y = x * 2; }
</file_content>
<file_content
path="[TEMP_DIR]/test.rs" status="patched_successfully" />
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,5 @@
source: crates/forge_services/src/tools/patch/apply.rs
expression: "TempDir::normalize(&result)"
---
<file_content path="[TEMP_DIR]/test.txt">
Hi World
Test Line
Goodbye World
</file_content>
<file_content
path="[TEMP_DIR]/test.txt" status="patched_successfully" />