Add delay before calling close command

This commit is contained in:
Saoud Rizwan
2024-09-05 10:32:13 -04:00
parent 93073512ce
commit 669b6a15c3
2 changed files with 3 additions and 2 deletions

View File

@@ -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) {