mirror of
https://github.com/pacnpal/Roo-Code.git
synced 2025-12-20 20:31:37 -05:00
Fix bug where write_to_file sometimes closed claude dev tab
This commit is contained in:
@@ -2,7 +2,7 @@
|
|||||||
"name": "claude-dev",
|
"name": "claude-dev",
|
||||||
"displayName": "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.",
|
"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.27",
|
"version": "1.5.28",
|
||||||
"icon": "icon.png",
|
"icon": "icon.png",
|
||||||
"engines": {
|
"engines": {
|
||||||
"vscode": "^1.84.0"
|
"vscode": "^1.84.0"
|
||||||
|
|||||||
@@ -875,15 +875,25 @@ export class ClaudeDev {
|
|||||||
// ensure that the in-memory doc is active editor (this seems to fail on windows machines if its already active, so ignoring if there's an error as it's likely it's already active anyways)
|
// ensure that the in-memory doc is active editor (this seems to fail on windows machines if its already active, so ignoring if there's an error as it's likely it's already active anyways)
|
||||||
try {
|
try {
|
||||||
await vscode.window.showTextDocument(inMemoryDocument, {
|
await vscode.window.showTextDocument(inMemoryDocument, {
|
||||||
preview: true,
|
preview: false, // ensures it opens in non-preview tab (preview tabs are easily replaced)
|
||||||
preserveFocus: false,
|
preserveFocus: false,
|
||||||
})
|
})
|
||||||
// await vscode.window.showTextDocument(inMemoryDocument.uri, { preview: true, preserveFocus: false })
|
// await vscode.window.showTextDocument(inMemoryDocument.uri, { preview: true, preserveFocus: false })
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
console.log(`Could not open editor for ${absolutePath}: ${error}`)
|
console.log(`Could not open editor for ${absolutePath}: ${error}`)
|
||||||
}
|
}
|
||||||
|
// 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 }
|
||||||
|
)
|
||||||
|
|
||||||
|
if (vscode.window.activeTextEditor?.document === inMemoryDocument) {
|
||||||
|
await vscode.commands.executeCommand("workbench.action.revertAndCloseActiveEditor") // allows us to close the untitled doc without being prompted to save it
|
||||||
|
}
|
||||||
|
|
||||||
await vscode.commands.executeCommand("workbench.action.revertAndCloseActiveEditor") // allows us to close the untitled doc without being prompted to save it
|
|
||||||
await this.closeDiffViews()
|
await this.closeDiffViews()
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user