mirror of
https://github.com/pacnpal/Roo-Code.git
synced 2025-12-20 04:11:10 -05:00
Fix issue where claude removes newline at end of files
This commit is contained in:
4
package-lock.json
generated
4
package-lock.json
generated
@@ -1,12 +1,12 @@
|
|||||||
{
|
{
|
||||||
"name": "claude-dev",
|
"name": "claude-dev",
|
||||||
"version": "1.0.81",
|
"version": "1.0.82",
|
||||||
"lockfileVersion": 3,
|
"lockfileVersion": 3,
|
||||||
"requires": true,
|
"requires": true,
|
||||||
"packages": {
|
"packages": {
|
||||||
"": {
|
"": {
|
||||||
"name": "claude-dev",
|
"name": "claude-dev",
|
||||||
"version": "1.0.81",
|
"version": "1.0.82",
|
||||||
"license": "MIT",
|
"license": "MIT",
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@anthropic-ai/sdk": "^0.24.3",
|
"@anthropic-ai/sdk": "^0.24.3",
|
||||||
|
|||||||
@@ -2,7 +2,7 @@
|
|||||||
"name": "claude-dev",
|
"name": "claude-dev",
|
||||||
"displayName": "Claude Dev",
|
"displayName": "Claude Dev",
|
||||||
"description": "Autonomous software engineer right in your IDE, capable of creating/editing files, executing commands, and more with your permission every step of the way.",
|
"description": "Autonomous software engineer right in your IDE, capable of creating/editing files, executing commands, and more with your permission every step of the way.",
|
||||||
"version": "1.0.81",
|
"version": "1.0.82",
|
||||||
"icon": "icon.png",
|
"icon": "icon.png",
|
||||||
"engines": {
|
"engines": {
|
||||||
"vscode": "^1.84.0"
|
"vscode": "^1.84.0"
|
||||||
|
|||||||
@@ -369,6 +369,10 @@ export class ClaudeDev {
|
|||||||
.catch(() => false)
|
.catch(() => false)
|
||||||
if (fileExists) {
|
if (fileExists) {
|
||||||
const originalContent = await fs.readFile(filePath, "utf-8")
|
const originalContent = await fs.readFile(filePath, "utf-8")
|
||||||
|
// fix issue where claude always removes newline from the file
|
||||||
|
if (originalContent.endsWith("\n") && !newContent.endsWith("\n")) {
|
||||||
|
newContent += "\n"
|
||||||
|
}
|
||||||
// condensed patch to return to claude
|
// condensed patch to return to claude
|
||||||
const diffResult = diff.createPatch(filePath, originalContent, newContent)
|
const diffResult = diff.createPatch(filePath, originalContent, newContent)
|
||||||
// full diff representation for webview
|
// full diff representation for webview
|
||||||
|
|||||||
Reference in New Issue
Block a user