Additional IDE integration polishes (#5985)

This commit is contained in:
Shreya Keshive 2025-08-11 12:27:45 -04:00 committed by GitHub
parent 8dd6f04199
commit b0b12af2ce
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
3 changed files with 18 additions and 9 deletions

View File

@ -72,7 +72,10 @@ function formatFileList(openFiles: File[]): string {
}) })
.join('\n'); .join('\n');
return `\n\nOpen files:\n${fileList}`; const infoMessage = `
(Note: The file list is limited to a number of recently accessed files within your workspace and only includes local files on disk)`;
return `\n\nOpen files:\n${fileList}\n${infoMessage}`;
} }
async function getIdeStatusMessageWithFiles(ideClient: IdeClient): Promise<{ async function getIdeStatusMessageWithFiles(ideClient: IdeClient): Promise<{
@ -128,7 +131,8 @@ export const ideCommand = (config: Config | null): SlashCommand | null => {
messageType: 'error', messageType: 'error',
content: `IDE integration is not supported in your current environment. To use this feature, run Gemini CLI in one of these supported IDEs: ${Object.values( content: `IDE integration is not supported in your current environment. To use this feature, run Gemini CLI in one of these supported IDEs: ${Object.values(
DetectedIde, DetectedIde,
).map((ide) => getIdeDisplayName(ide))} )
.map((ide) => getIdeDisplayName(ide))
.join(', ')}`, .join(', ')}`,
}) as const, }) as const,
}; };

View File

@ -215,13 +215,18 @@ export class IdeClient {
// disconnected, so that the first detail message is preserved. // disconnected, so that the first detail message is preserved.
if (!isAlreadyDisconnected) { if (!isAlreadyDisconnected) {
this.state = { status, details }; this.state = { status, details };
if (logToConsole) { if (details) {
logger.error(details); if (logToConsole) {
logger.error(details);
} else {
// We only want to log disconnect messages to debug
// if they are not already being logged to the console.
logger.debug(details);
}
} }
} }
if (status === IDEConnectionStatus.Disconnected) { if (status === IDEConnectionStatus.Disconnected) {
logger.debug(details);
ideContext.clearIdeContext(); ideContext.clearIdeContext();
} }
} }
@ -260,7 +265,7 @@ export class IdeClient {
if (!port) { if (!port) {
this.setState( this.setState(
IDEConnectionStatus.Disconnected, IDEConnectionStatus.Disconnected,
`Failed to connect to IDE companion extension for ${this.currentIdeDisplayName}. Please ensure the extension is running and try refreshing your terminal. To install the extension, run /ide install.`, `Failed to connect to IDE companion extension for ${this.currentIdeDisplayName}. Please ensure the extension is running and try restarting your terminal. To install the extension, run /ide install.`,
true, true,
); );
return undefined; return undefined;
@ -339,7 +344,7 @@ export class IdeClient {
} catch (_error) { } catch (_error) {
this.setState( this.setState(
IDEConnectionStatus.Disconnected, IDEConnectionStatus.Disconnected,
`Failed to connect to IDE companion extension for ${this.currentIdeDisplayName}. Please ensure the extension is running and try refreshing your terminal. To install the extension, run /ide install.`, `Failed to connect to IDE companion extension for ${this.currentIdeDisplayName}. Please ensure the extension is running and try restarting your terminal. To install the extension, run /ide install.`,
true, true,
); );
if (transport) { if (transport) {

View File

@ -1,6 +1,6 @@
# Gemini CLI Companion # Gemini CLI Companion
The Gemini CLI Companion extension seamlessly integrates [Gemini CLI](https://github.com/google-gemini/gemini-cli) into your VS Code environment. This integration enables Gemini CLI to access active information like your open files. The Gemini CLI Companion extension seamlessly integrates [Gemini CLI](https://github.com/google-gemini/gemini-cli) into your IDE.
# Features # Features
@ -17,7 +17,7 @@ The Gemini CLI Companion extension seamlessly integrates [Gemini CLI](https://gi
To use this extension, you'll need: To use this extension, you'll need:
- VS Code version 1.99.0 or newer - VS Code version 1.99.0 or newer
- Gemini CLI (installed separately) running within the VS Code integrated terminal - Gemini CLI (installed separately) running within the integrated terminal
# Terms of Service and Privacy Notice # Terms of Service and Privacy Notice