fix: LSP tools Windows compatibility - use pathToFileURL for proper URI generation (#689)

This commit is contained in:
yimingll
2026-01-11 18:01:54 +08:00
committed by GitHub
parent b5451c1469
commit 820eb03d4e
2 changed files with 14 additions and 11 deletions
+3 -1
View File
@@ -30,12 +30,14 @@ export function findWorkspaceRoot(filePath: string): string {
const markers = [".git", "package.json", "pyproject.toml", "Cargo.toml", "go.mod", "pom.xml", "build.gradle"]
while (dir !== "/") {
let prevDir = ""
while (dir !== prevDir) {
for (const marker of markers) {
if (existsSync(require("path").join(dir, marker))) {
return dir
}
}
prevDir = dir
dir = require("path").dirname(dir)
}