diff options
| author | Shreya Keshive <[email protected]> | 2025-08-12 17:08:07 -0400 |
|---|---|---|
| committer | GitHub <[email protected]> | 2025-08-12 21:08:07 +0000 |
| commit | 3a87712c1a15dac9f0a717b40fbf9e59398177ca (patch) | |
| tree | 44a0f199403b5b366d80bc8caf2b5d63242acba1 /packages/cli/src/ui | |
| parent | d219f9013206aad5a1361e436ad4a45114e9cd49 (diff) | |
Launch VS Code IDE Integration (#6063)
Diffstat (limited to 'packages/cli/src/ui')
| -rw-r--r-- | packages/cli/src/ui/App.test.tsx | 4 | ||||
| -rw-r--r-- | packages/cli/src/ui/App.tsx | 1 | ||||
| -rw-r--r-- | packages/cli/src/ui/commands/ideCommand.test.ts | 11 | ||||
| -rw-r--r-- | packages/cli/src/ui/commands/ideCommand.ts | 2 | ||||
| -rw-r--r-- | packages/cli/src/ui/components/messages/ToolConfirmationMessage.tsx | 4 |
5 files changed, 8 insertions, 14 deletions
diff --git a/packages/cli/src/ui/App.test.tsx b/packages/cli/src/ui/App.test.tsx index 82ba4fe1..3636823b 100644 --- a/packages/cli/src/ui/App.test.tsx +++ b/packages/cli/src/ui/App.test.tsx @@ -155,13 +155,13 @@ vi.mock('@google/gemini-cli-core', async (importOriginal) => { setFlashFallbackHandler: vi.fn(), getSessionId: vi.fn(() => 'test-session-id'), getUserTier: vi.fn().mockResolvedValue(undefined), - getIdeModeFeature: vi.fn(() => false), - getIdeMode: vi.fn(() => false), + getIdeMode: vi.fn(() => true), getWorkspaceContext: vi.fn(() => ({ getDirectories: vi.fn(() => []), })), getIdeClient: vi.fn(() => ({ getCurrentIde: vi.fn(() => 'vscode'), + getDetectedIdeDisplayName: vi.fn(() => 'VSCode'), })), }; }); diff --git a/packages/cli/src/ui/App.tsx b/packages/cli/src/ui/App.tsx index ab30b730..1caabbe0 100644 --- a/packages/cli/src/ui/App.tsx +++ b/packages/cli/src/ui/App.tsx @@ -130,7 +130,6 @@ const App = ({ config, settings, startupWarnings = [], version }: AppProps) => { registerCleanup(() => config.getIdeClient().disconnect()); }, [config]); const shouldShowIdePrompt = - config.getIdeModeFeature() && currentIDE && !config.getIdeMode() && !settings.merged.hasSeenIdeIntegrationNudge && diff --git a/packages/cli/src/ui/commands/ideCommand.test.ts b/packages/cli/src/ui/commands/ideCommand.test.ts index 10a97e2a..8576320b 100644 --- a/packages/cli/src/ui/commands/ideCommand.test.ts +++ b/packages/cli/src/ui/commands/ideCommand.test.ts @@ -40,7 +40,6 @@ describe('ideCommand', () => { } as unknown as CommandContext; mockConfig = { - getIdeModeFeature: vi.fn(), getIdeMode: vi.fn(), getIdeClient: vi.fn(() => ({ reconnect: vi.fn(), @@ -60,14 +59,12 @@ describe('ideCommand', () => { vi.restoreAllMocks(); }); - it('should return null if ideModeFeature is not enabled', () => { - vi.mocked(mockConfig.getIdeModeFeature).mockReturnValue(false); - const command = ideCommand(mockConfig); + it('should return null if config is not provided', () => { + const command = ideCommand(null); expect(command).toBeNull(); }); - it('should return the ide command if ideModeFeature is enabled', () => { - vi.mocked(mockConfig.getIdeModeFeature).mockReturnValue(true); + it('should return the ide command', () => { vi.mocked(mockConfig.getIdeMode).mockReturnValue(true); vi.mocked(mockConfig.getIdeClient).mockReturnValue({ getCurrentIde: () => DetectedIde.VSCode, @@ -85,7 +82,6 @@ describe('ideCommand', () => { describe('status subcommand', () => { const mockGetConnectionStatus = vi.fn(); beforeEach(() => { - vi.mocked(mockConfig.getIdeModeFeature).mockReturnValue(true); vi.mocked(mockConfig.getIdeClient).mockReturnValue({ getConnectionStatus: mockGetConnectionStatus, getCurrentIde: () => DetectedIde.VSCode, @@ -162,7 +158,6 @@ describe('ideCommand', () => { describe('install subcommand', () => { const mockInstall = vi.fn(); beforeEach(() => { - vi.mocked(mockConfig.getIdeModeFeature).mockReturnValue(true); vi.mocked(mockConfig.getIdeMode).mockReturnValue(true); vi.mocked(mockConfig.getIdeClient).mockReturnValue({ getCurrentIde: () => DetectedIde.VSCode, diff --git a/packages/cli/src/ui/commands/ideCommand.ts b/packages/cli/src/ui/commands/ideCommand.ts index 23af2e48..2dfad33c 100644 --- a/packages/cli/src/ui/commands/ideCommand.ts +++ b/packages/cli/src/ui/commands/ideCommand.ts @@ -115,7 +115,7 @@ async function getIdeStatusMessageWithFiles(ideClient: IdeClient): Promise<{ } export const ideCommand = (config: Config | null): SlashCommand | null => { - if (!config || !config.getIdeModeFeature()) { + if (!config) { return null; } const ideClient = config.getIdeClient(); diff --git a/packages/cli/src/ui/components/messages/ToolConfirmationMessage.tsx b/packages/cli/src/ui/components/messages/ToolConfirmationMessage.tsx index a8813491..2f93609e 100644 --- a/packages/cli/src/ui/components/messages/ToolConfirmationMessage.tsx +++ b/packages/cli/src/ui/components/messages/ToolConfirmationMessage.tsx @@ -45,7 +45,7 @@ export const ToolConfirmationMessage: React.FC< const handleConfirm = async (outcome: ToolConfirmationOutcome) => { if (confirmationDetails.type === 'edit') { const ideClient = config?.getIdeClient(); - if (config?.getIdeMode() && config?.getIdeModeFeature()) { + if (config?.getIdeMode()) { const cliOutcome = outcome === ToolConfirmationOutcome.Cancel ? 'rejected' : 'accepted'; await ideClient?.resolveDiffFromCli( @@ -136,7 +136,7 @@ export const ToolConfirmationMessage: React.FC< value: ToolConfirmationOutcome.ProceedAlways, }, ); - if (config?.getIdeMode() && config?.getIdeModeFeature()) { + if (config?.getIdeMode()) { options.push({ label: 'No (esc)', value: ToolConfirmationOutcome.Cancel, |
