diff options
| author | christine betts <[email protected]> | 2025-07-21 20:52:02 +0000 |
|---|---|---|
| committer | GitHub <[email protected]> | 2025-07-21 20:52:02 +0000 |
| commit | 1969d805f2fd559e2227a8822de5be66d3d8a184 (patch) | |
| tree | e9a84b780a87a67778730b806fad0df770aebec6 /packages/vscode-ide-companion/src | |
| parent | d7a57d85a39535e84bba7e65eb02dcb627b9cb81 (diff) | |
[ide-mode] Use active files and selected text in user prompt (#4614)
Diffstat (limited to 'packages/vscode-ide-companion/src')
| -rw-r--r-- | packages/vscode-ide-companion/src/ide-server.ts | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/packages/vscode-ide-companion/src/ide-server.ts b/packages/vscode-ide-companion/src/ide-server.ts index 37e07737..9111f349 100644 --- a/packages/vscode-ide-companion/src/ide-server.ts +++ b/packages/vscode-ide-companion/src/ide-server.ts @@ -19,7 +19,7 @@ import { RecentFilesManager } from './recent-files-manager.js'; const MCP_SESSION_ID_HEADER = 'mcp-session-id'; const IDE_SERVER_PORT_ENV_VAR = 'GEMINI_CLI_IDE_SERVER_PORT'; -function sendActiveFileChangedNotification( +function sendOpenFilesChangedNotification( transport: StreamableHTTPServerTransport, logger: vscode.OutputChannel, recentFilesManager: RecentFilesManager, @@ -29,9 +29,9 @@ function sendActiveFileChangedNotification( logger.appendLine(`Sending active file changed notification: ${filePath}`); const notification: JSONRPCNotification = { jsonrpc: '2.0', - method: 'ide/activeFileChanged', + method: 'ide/openFilesChanged', params: { - filePath, + activeFile: filePath, recentOpenFiles: recentFilesManager.recentFiles, }, }; @@ -60,7 +60,7 @@ export class IDEServer { const recentFilesManager = new RecentFilesManager(context); const disposable = recentFilesManager.onDidChange(() => { for (const transport of Object.values(transports)) { - sendActiveFileChangedNotification( + sendOpenFilesChangedNotification( transport, this.logger, recentFilesManager, @@ -168,7 +168,7 @@ export class IDEServer { } if (!sessionsWithInitialNotification.has(sessionId)) { - sendActiveFileChangedNotification( + sendOpenFilesChangedNotification( transport, this.logger, recentFilesManager, @@ -224,7 +224,7 @@ const createMcpServer = () => { { capabilities: { logging: {} } }, ); server.registerTool( - 'getActiveFile', + 'getOpenFiles', { description: '(IDE Tool) Get the path of the file currently active in VS Code.', |
