mirror of
https://github.com/QwenLM/qwen-code.git
synced 2025-12-19 09:33:53 +00:00
[ide-mode] Create an IDE manager class to handle connecting to and exposing methods from the IDE server (#4797)
This commit is contained in:
@@ -244,34 +244,5 @@ const createMcpServer = () => {
|
||||
},
|
||||
{ capabilities: { logging: {} } },
|
||||
);
|
||||
server.registerTool(
|
||||
'getOpenFiles',
|
||||
{
|
||||
description:
|
||||
'(IDE Tool) Get the path of the file currently active in VS Code.',
|
||||
inputSchema: {},
|
||||
},
|
||||
async () => {
|
||||
const editor = vscode.window.activeTextEditor;
|
||||
const filePath =
|
||||
editor && editor.document.uri.scheme === 'file'
|
||||
? editor.document.uri.fsPath
|
||||
: '';
|
||||
if (filePath) {
|
||||
return {
|
||||
content: [{ type: 'text', text: `Active file: ${filePath}` }],
|
||||
};
|
||||
} else {
|
||||
return {
|
||||
content: [
|
||||
{
|
||||
type: 'text',
|
||||
text: 'No file is currently active in the editor.',
|
||||
},
|
||||
],
|
||||
};
|
||||
}
|
||||
},
|
||||
);
|
||||
return server;
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user