[ide-mode] Create an IDE manager class to handle connecting to and exposing methods from the IDE server (#4797)

This commit is contained in:
christine betts
2025-07-25 17:46:55 +00:00
committed by GitHub
parent 3c16429fc4
commit 1b8ba5ca6b
14 changed files with 178 additions and 256 deletions

View File

@@ -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;
};