Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions src/filesystem/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ import { z } from "zod";
import { minimatch } from "minimatch";
import { normalizePath, expandHome } from './path-utils.js';
import { getValidRootDirectories } from './roots-utils.js';
import { fileURLToPath } from "url";
import {
// Function imports
formatSize,
Expand Down Expand Up @@ -700,6 +701,11 @@ server.server.setNotificationHandler(RootsListChangedNotificationSchema, async (
try {
// Request the updated roots list from the client
const response = await server.server.listRoots();
for (const root of response.roots) {
// console.error("root", fileURLToPath(root.uri));
// fix windows url encode file:///d%3A/work/
root.uri = fileURLToPath(root.uri);
}
if (response && 'roots' in response) {
await updateAllowedDirectoriesFromRoots(response.roots);
}
Expand Down