refactor(vscode-ide-companion): Reduce VSIX size and improve build process (#9118)

This commit is contained in:
Shreya Keshive
2025-09-22 12:12:43 -04:00
committed by GitHub
parent 92543da28c
commit 9abb165f7b
8 changed files with 42 additions and 33 deletions
@@ -7,7 +7,7 @@
import {
IdeDiffAcceptedNotificationSchema,
IdeDiffClosedNotificationSchema,
} from '@google/gemini-cli-core';
} from '@google/gemini-cli-core/src/ide/types.js';
import { type JSONRPCNotification } from '@modelcontextprotocol/sdk/types.js';
import * as path from 'node:path';
import * as vscode from 'vscode';
@@ -7,10 +7,15 @@
import { afterEach, beforeEach, describe, expect, it, vi } from 'vitest';
import * as vscode from 'vscode';
import { activate } from './extension.js';
import { IDE_DEFINITIONS, detectIdeFromEnv } from '@google/gemini-cli-core';
import {
IDE_DEFINITIONS,
detectIdeFromEnv,
} from '@google/gemini-cli-core/src/ide/detect-ide.js';
vi.mock('@google/gemini-cli-core', async () => {
const actual = await vi.importActual('@google/gemini-cli-core');
vi.mock('@google/gemini-cli-core/src/ide/detect-ide.js', async () => {
const actual = await vi.importActual(
'@google/gemini-cli-core/src/ide/detect-ide.js',
);
return {
...actual,
detectIdeFromEnv: vi.fn(() => IDE_DEFINITIONS.vscode),
@@ -13,7 +13,7 @@ import {
detectIdeFromEnv,
IDE_DEFINITIONS,
type IdeInfo,
} from '@google/gemini-cli-core';
} from '@google/gemini-cli-core/src/ide/detect-ide.js';
const CLI_IDE_COMPANION_IDENTIFIER = 'Google.gemini-cli-vscode-ide-companion';
const INFO_MESSAGE_SHOWN_KEY = 'geminiCliInfoMessageShown';
@@ -9,7 +9,7 @@ import {
CloseDiffRequestSchema,
IdeContextNotificationSchema,
OpenDiffRequestSchema,
} from '@google/gemini-cli-core';
} from '@google/gemini-cli-core/src/ide/types.js';
import { isInitializeRequest } from '@modelcontextprotocol/sdk/types.js';
import { McpServer } from '@modelcontextprotocol/sdk/server/mcp.js';
import { StreamableHTTPServerTransport } from '@modelcontextprotocol/sdk/server/streamableHttp.js';
@@ -5,7 +5,10 @@
*/
import * as vscode from 'vscode';
import type { File, IdeContext } from '@google/gemini-cli-core';
import type {
File,
IdeContext,
} from '@google/gemini-cli-core/src/ide/types.js';
export const MAX_FILES = 10;
const MAX_SELECTED_TEXT_LENGTH = 16384; // 16 KiB limit