diff options
| author | christine betts <[email protected]> | 2025-08-08 15:38:30 +0000 |
|---|---|---|
| committer | GitHub <[email protected]> | 2025-08-08 15:38:30 +0000 |
| commit | 3af4913ef3f00de71744de551a568aa713a3beec (patch) | |
| tree | ca71aae771662435a4c01400a701b48a4c5dbcf3 /packages/core/src | |
| parent | 5ec4ea9b4d425269c9e9052503ad85b5caaa976e (diff) | |
[ide-mode] Close all open diffs when the CLI gets closed (#5792)
Diffstat (limited to 'packages/core/src')
| -rw-r--r-- | packages/core/src/config/config.ts | 2 | ||||
| -rw-r--r-- | packages/core/src/ide/ide-client.ts | 9 |
2 files changed, 9 insertions, 2 deletions
diff --git a/packages/core/src/config/config.ts b/packages/core/src/config/config.ts index 473ab5a6..a06c4505 100644 --- a/packages/core/src/config/config.ts +++ b/packages/core/src/config/config.ts @@ -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(); } } diff --git a/packages/core/src/ide/ide-client.ts b/packages/core/src/ide/ide-client.ts index 5ffcc2e3..6d8be7fa 100644 --- a/packages/core/src/ide/ide-client.ts +++ b/packages/core/src/ide/ide-client.ts @@ -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.', |
