Add drawer for active files in IDE mode (#4682)

Co-authored-by: Shreya <shreyakeshive@google.com>
This commit is contained in:
christine betts
2025-07-25 14:50:34 +00:00
committed by GitHub
parent 5d4b02ca85
commit 1d3ad9d075
5 changed files with 112 additions and 23 deletions

View File

@@ -252,8 +252,11 @@ const createMcpServer = () => {
inputSchema: {},
},
async () => {
const activeEditor = vscode.window.activeTextEditor;
const filePath = activeEditor ? activeEditor.document.uri.fsPath : '';
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}` }],