mirror of
https://github.com/google-gemini/gemini-cli.git
synced 2026-04-24 20:14:44 -07:00
Use IdeClient directly instead of config.ideClient (#7627)
This commit is contained in:
committed by
GitHub
parent
45d494a8d8
commit
cb43bb9ca4
@@ -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
|
||||
*/
|
||||
|
||||
Reference in New Issue
Block a user