[ide-mode] Suggest the extension name in the installation messages (#6182)

This commit is contained in:
christine betts 2025-08-14 14:57:36 +00:00 committed by GitHub
parent 2fc1ef7d59
commit d6403c67ee
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
4 changed files with 13 additions and 3 deletions

View File

@ -7,6 +7,7 @@
import {
Config,
DetectedIde,
GEMINI_CLI_COMPANION_EXTENSION_NAME,
IDEConnectionStatus,
getIdeInfo,
getIdeInstaller,
@ -170,7 +171,7 @@ export const ideCommand = (config: Config | null): SlashCommand | null => {
context.ui.addItem(
{
type: 'error',
text: `No installer is available for ${ideClient.getDetectedIdeDisplayName()}. Please install the IDE companion manually from its marketplace.`,
text: `No installer is available for ${ideClient.getDetectedIdeDisplayName()}. Please install the '${GEMINI_CLI_COMPANION_EXTENSION_NAME}' extension manually from the marketplace.`,
},
Date.now(),
);

View File

@ -0,0 +1,7 @@
/**
* @license
* Copyright 2025 Google LLC
* SPDX-License-Identifier: Apache-2.0
*/
export const GEMINI_CLI_COMPANION_EXTENSION_NAME = 'Gemini CLI Companion';

View File

@ -10,6 +10,7 @@ import * as path from 'path';
import * as fs from 'fs';
import * as os from 'os';
import { DetectedIde } from './detect-ide.js';
import { GEMINI_CLI_COMPANION_EXTENSION_NAME } from './constants.js';
const VSCODE_COMMAND = process.platform === 'win32' ? 'code.cmd' : 'code';
@ -96,7 +97,7 @@ class VsCodeInstaller implements IdeInstaller {
if (!commandPath) {
return {
success: false,
message: `VS Code CLI not found. Please ensure 'code' is in your system's PATH. For help, see https://code.visualstudio.com/docs/configure/command-line#_code-is-not-recognized-as-an-internal-or-external-command. You can also install the companion extension manually from the VS Code marketplace.`,
message: `VS Code CLI not found. Please ensure 'code' is in your system's PATH. For help, see https://code.visualstudio.com/docs/configure/command-line#_code-is-not-recognized-as-an-internal-or-external-command. You can also install the '${GEMINI_CLI_COMPANION_EXTENSION_NAME}' extension manually from the VS Code marketplace.`,
};
}
@ -111,7 +112,7 @@ class VsCodeInstaller implements IdeInstaller {
} catch (_error) {
return {
success: false,
message: `Failed to install VS Code companion extension. Please try installing it manually from the VS Code marketplace.`,
message: `Failed to install VS Code companion extension. Please try installing '${GEMINI_CLI_COMPANION_EXTENSION_NAME}' manually from the VS Code extension marketplace.`,
};
}
}

View File

@ -52,6 +52,7 @@ export * from './ide/ide-client.js';
export * from './ide/ideContext.js';
export * from './ide/ide-installer.js';
export { getIdeInfo, DetectedIde, IdeInfo } from './ide/detect-ide.js';
export * from './ide/constants.js';
// Export Shell Execution Service
export * from './services/shellExecutionService.js';