mirror of
https://github.com/QwenLM/qwen-code.git
synced 2025-12-20 16:57:46 +00:00
Adds the user's active file in the IDE to the footer (#4154)
This commit is contained in:
@@ -20,6 +20,11 @@ import { MCPServerConfig } from '../config/config.js';
|
||||
import { DiscoveredMCPTool } from './mcp-tool.js';
|
||||
import { FunctionDeclaration, Type, mcpToTool } from '@google/genai';
|
||||
import { sanitizeParameters, ToolRegistry } from './tool-registry.js';
|
||||
import {
|
||||
ActiveFileNotificationSchema,
|
||||
IDE_SERVER_NAME,
|
||||
ideContext,
|
||||
} from '../services/ideContext.js';
|
||||
|
||||
export const MCP_DEFAULT_TIMEOUT_MSEC = 10 * 60 * 1000; // default to 10 minutes
|
||||
|
||||
@@ -211,6 +216,15 @@ export async function connectAndDiscover(
|
||||
updateMCPServerStatus(mcpServerName, MCPServerStatus.DISCONNECTED);
|
||||
};
|
||||
|
||||
if (mcpServerName === IDE_SERVER_NAME) {
|
||||
mcpClient.setNotificationHandler(
|
||||
ActiveFileNotificationSchema,
|
||||
(notification) => {
|
||||
ideContext.setActiveFileContext(notification.params);
|
||||
},
|
||||
);
|
||||
}
|
||||
|
||||
const tools = await discoverTools(
|
||||
mcpServerName,
|
||||
mcpServerConfig,
|
||||
|
||||
Reference in New Issue
Block a user