[ide-mode] Close all open diffs when the CLI gets closed (#5792)

This commit is contained in:
christine betts
2025-08-08 15:38:30 +00:00
committed by GitHub
parent 5ec4ea9b4d
commit 3af4913ef3
7 changed files with 126 additions and 7 deletions

View File

@@ -684,7 +684,7 @@ export class Config {
await this.ideClient.connect();
logIdeConnection(this, new IdeConnectionEvent(IdeConnectionType.SESSION));
} else {
this.ideClient.disconnect();
await this.ideClient.disconnect();
}
}

View File

@@ -175,7 +175,14 @@ export class IdeClient {
}
}
disconnect() {
async disconnect() {
if (this.state.status === IDEConnectionStatus.Disconnected) {
return;
}
for (const filePath of this.diffResponses.keys()) {
await this.closeDiff(filePath);
}
this.diffResponses.clear();
this.setState(
IDEConnectionStatus.Disconnected,
'IDE integration disabled. To enable it again, run /ide enable.',