Use IdeClient directly instead of config.ideClient (#7627)

This commit is contained in:
Tommaso Sciortino
2025-09-04 09:32:09 -07:00
committed by GitHub
parent 45d494a8d8
commit cb43bb9ca4
24 changed files with 288 additions and 217 deletions
+7 -16
View File
@@ -260,7 +260,7 @@ export class Config {
private readonly folderTrustFeature: boolean;
private readonly folderTrust: boolean;
private ideMode: boolean;
private ideClient!: IdeClient;
private inFallbackMode = false;
private readonly maxSessionTurns: number;
private readonly listExtensions: boolean;
@@ -383,7 +383,12 @@ export class Config {
throw Error('Config was already initialized');
}
this.initialized = true;
this.ideClient = await IdeClient.getInstance();
if (this.getIdeMode()) {
await (await IdeClient.getInstance()).connect();
logIdeConnection(this, new IdeConnectionEvent(IdeConnectionType.START));
}
// Initialize centralized FileDiscoveryService
this.getFileService();
if (this.getCheckpointingEnabled()) {
@@ -762,20 +767,6 @@ export class Config {
this.ideMode = value;
}
async setIdeModeAndSyncConnection(value: boolean): Promise<void> {
this.ideMode = value;
if (value) {
await this.ideClient.connect();
logIdeConnection(this, new IdeConnectionEvent(IdeConnectionType.SESSION));
} else {
await this.ideClient.disconnect();
}
}
getIdeClient(): IdeClient {
return this.ideClient;
}
/**
* Get the current FileSystemService
*/