fix: properly encode file URLs with special characters (#12424)

This commit is contained in:
Khang Ha (Kelvin)
2026-02-07 05:16:56 +07:00
committed by GitHub
parent e9a3cfc083
commit fde0b39b7c
12 changed files with 114 additions and 22 deletions

View File

@@ -3,7 +3,7 @@ import { Bus } from "@/bus"
import { Log } from "../util/log"
import { LSPClient } from "./client"
import path from "path"
import { pathToFileURL } from "url"
import { pathToFileURL, fileURLToPath } from "url"
import { LSPServer } from "./server"
import z from "zod"
import { Config } from "../config/config"
@@ -369,7 +369,7 @@ export namespace LSP {
}
export async function documentSymbol(uri: string) {
const file = new URL(uri).pathname
const file = fileURLToPath(uri)
return run(file, (client) =>
client.connection
.sendRequest("textDocument/documentSymbol", {