mirror of
https://github.com/QwenLM/qwen-code.git
synced 2025-12-20 16:57:46 +00:00
[ide-mode] Use active files and selected text in user prompt (#4614)
This commit is contained in:
@@ -22,7 +22,7 @@ import { DiscoveredMCPTool } from './mcp-tool.js';
|
||||
import { FunctionDeclaration, mcpToTool } from '@google/genai';
|
||||
import { ToolRegistry } from './tool-registry.js';
|
||||
import {
|
||||
ActiveFileNotificationSchema,
|
||||
OpenFilesNotificationSchema,
|
||||
IDE_SERVER_NAME,
|
||||
ideContext,
|
||||
} from '../services/ideContext.js';
|
||||
@@ -217,15 +217,15 @@ export async function connectAndDiscover(
|
||||
console.error(`MCP ERROR (${mcpServerName}):`, error.toString());
|
||||
updateMCPServerStatus(mcpServerName, MCPServerStatus.DISCONNECTED);
|
||||
if (mcpServerName === IDE_SERVER_NAME) {
|
||||
ideContext.clearActiveFileContext();
|
||||
ideContext.clearOpenFilesContext();
|
||||
}
|
||||
};
|
||||
|
||||
if (mcpServerName === IDE_SERVER_NAME) {
|
||||
mcpClient.setNotificationHandler(
|
||||
ActiveFileNotificationSchema,
|
||||
OpenFilesNotificationSchema,
|
||||
(notification) => {
|
||||
ideContext.setActiveFileContext(notification.params);
|
||||
ideContext.setOpenFilesContext(notification.params);
|
||||
},
|
||||
);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user