From 46f14f32d157de49f3f26bcd41c9e961de9c4c6e Mon Sep 17 00:00:00 2001 From: Saoud Rizwan <7799382+saoudrizwan@users.noreply.github.com> Date: Wed, 10 Jul 2024 11:15:25 -0400 Subject: [PATCH] Fix issue where file diff could fail; minor style changes; update README; update version to 0.0.4 --- README.md | 2 +- package.json | 2 +- src/ClaudeDev.ts | 13 +++++-------- webview-ui/src/components/CodeBlock.tsx | 1 + 4 files changed, 8 insertions(+), 10 deletions(-) diff --git a/README.md b/README.md index 45a6c11..ce0221d 100644 --- a/README.md +++ b/README.md @@ -62,7 +62,7 @@ Claude Dev even offered to run a command that would open it in Chrome for me. From idea to functional website in seconds. Thanks, Claude Dev! -![image](https://github.com/saoudrizwan/claude-dev/assets/7799382/30774572-abe2-43b3-8bc5-917e115b4def) +![image](https://github.com/saoudrizwan/claude-dev/assets/7799382/b3a4c801-e8d6-4e20-96c4-2c7094a20664) ## Installation diff --git a/package.json b/package.json index 74a3d2d..440e6ea 100644 --- a/package.json +++ b/package.json @@ -2,7 +2,7 @@ "name": "claude-dev", "displayName": "Claude Dev", "description": "Claude Dev goes beyond simple code completion by reading & writing files, creating projects, and executing terminal commands with your permission.", - "version": "0.0.3", + "version": "0.0.4", "engines": { "vscode": "^1.82.0" }, diff --git a/src/ClaudeDev.ts b/src/ClaudeDev.ts index 50cc9fa..db07ca0 100644 --- a/src/ClaudeDev.ts +++ b/src/ClaudeDev.ts @@ -95,8 +95,7 @@ const tools: Tool[] = [ properties: { path: { type: "string", - description: - "The path of the directory to list contents for.", + description: "The path of the directory to list contents for.", }, }, required: ["path"], @@ -111,8 +110,7 @@ const tools: Tool[] = [ properties: { path: { type: "string", - description: - "The path of the file to read.", + description: "The path of the file to read.", }, }, required: ["path"], @@ -127,8 +125,7 @@ const tools: Tool[] = [ properties: { path: { type: "string", - description: - "The path of the file to write to.", + description: "The path of the file to write to.", }, content: { type: "string", @@ -317,14 +314,14 @@ export class ClaudeDev { const completeDiffStringConverted = completeDiffStringRaw .map((part, index) => { const prefix = part.added ? "+ " : part.removed ? "- " : " " - return part.value + return (part.value ?? []) .split("\n") .map((line, lineIndex) => { // avoid adding an extra empty line at the very end of the diff output if ( line === "" && index === completeDiffStringRaw.length - 1 && - lineIndex === part.value.split("\n").length - 1 + lineIndex === (part.value ?? []).split("\n").length - 1 ) { return null } diff --git a/webview-ui/src/components/CodeBlock.tsx b/webview-ui/src/components/CodeBlock.tsx index 6845ab8..cffbc73 100644 --- a/webview-ui/src/components/CodeBlock.tsx +++ b/webview-ui/src/components/CodeBlock.tsx @@ -109,6 +109,7 @@ const CodeBlock = ({ code, diff, language, path }: CodeBlockProps) => { overflow: "hidden", textOverflow: "ellipsis", marginRight: "8px", + fontSize: "11px", // trick to get ellipsis at beginning of string direction: "rtl", textAlign: "left",