From 669b6a15c345c39017a4684003eca6bdc7d09793 Mon Sep 17 00:00:00 2001 From: Saoud Rizwan <7799382+saoudrizwan@users.noreply.github.com> Date: Thu, 5 Sep 2024 10:32:13 -0400 Subject: [PATCH] Add delay before calling close command --- package.json | 2 +- src/ClaudeDev.ts | 3 ++- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/package.json b/package.json index 4d17743..e4ffb6c 100644 --- a/package.json +++ b/package.json @@ -2,7 +2,7 @@ "name": "claude-dev", "displayName": "Claude Dev", "description": "Autonomous coding agent right in your IDE, capable of creating/editing files, executing commands, and more with your permission every step of the way.", - "version": "1.5.28", + "version": "1.5.29", "icon": "icon.png", "engines": { "vscode": "^1.84.0" diff --git a/src/ClaudeDev.ts b/src/ClaudeDev.ts index 3913eb9..4712eaf 100644 --- a/src/ClaudeDev.ts +++ b/src/ClaudeDev.ts @@ -882,12 +882,13 @@ export class ClaudeDev { } catch (error) { console.log(`Could not open editor for ${absolutePath}: ${error}`) } + await delay(50) // Wait for the in-memory document to become the active editor (sometimes vscode timing issues happen and this would accidentally close claude dev!) await pWaitFor( () => { return vscode.window.activeTextEditor?.document === inMemoryDocument }, - { timeout: 5000, interval: 100 } + { timeout: 5000, interval: 50 } ) if (vscode.window.activeTextEditor?.document === inMemoryDocument) {