refactor(ide): Improve IDE detection discovery (#6765)

This commit is contained in:
Shreya Keshive
2025-08-25 11:39:57 -07:00
committed by GitHub
parent 0641b1c095
commit 776627c855
13 changed files with 373 additions and 152 deletions

View File

@@ -88,7 +88,7 @@ export function IdeIntegrationNudge({
<Box marginBottom={1} flexDirection="column">
<Text>
<Text color="yellow">{'> '}</Text>
{`Do you want to connect ${ideName ?? 'your'} editor to Gemini CLI?`}
{`Do you want to connect ${ideName ?? 'your editor'} to Gemini CLI?`}
</Text>
<Text dimColor>{installText}</Text>
</Box>

View File

@@ -6,10 +6,8 @@
import {
Config,
DetectedIde,
GEMINI_CLI_COMPANION_EXTENSION_NAME,
IDEConnectionStatus,
getIdeInfo,
getIdeInstaller,
IdeClient,
type File,
@@ -130,11 +128,7 @@ export const ideCommand = (config: Config | null): SlashCommand | null => {
({
type: 'message',
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(
DetectedIde,
)
.map((ide) => getIdeInfo(ide).displayName)
.join(', ')}`,
content: `IDE integration is not supported in your current environment. To use this feature, run Gemini CLI in one of these supported IDEs: VS Code or VS Code forks.`,
}) as const,
};
}

View File

@@ -86,6 +86,7 @@ import { McpPromptLoader } from '../../services/McpPromptLoader.js';
import {
SlashCommandStatus,
makeFakeConfig,
type IdeClient,
} from '@google/gemini-cli-core/index.js';
function createTestCommand(
@@ -109,6 +110,10 @@ describe('useSlashCommandProcessor', () => {
const mockSetQuittingMessages = vi.fn();
const mockConfig = makeFakeConfig({});
vi.spyOn(mockConfig, 'getIdeClient').mockReturnValue({
addStatusChangeListener: vi.fn(),
removeStatusChangeListener: vi.fn(),
} as unknown as IdeClient);
const mockSettings = {} as LoadedSettings;