From 0d29c5675052aa19b6c410947eb4a21788fc0f97 Mon Sep 17 00:00:00 2001 From: cfngc4594 Date: Wed, 5 Mar 2025 19:21:35 +0800 Subject: [PATCH] feat(language-server): add logging for URL creation in connectToLanguageServer --- src/lib/language-server.ts | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/src/lib/language-server.ts b/src/lib/language-server.ts index e874134..27604c5 100644 --- a/src/lib/language-server.ts +++ b/src/lib/language-server.ts @@ -6,9 +6,7 @@ import { toSocket, WebSocketMessageReader, WebSocketMessageWriter } from "vscode // Create the WebSocket URL based on the protocol and port function createUrl(protocol: string, hostname: string, port: number | null, path: string | null): string { - const formattedPort = port !== null ? `:${port}` : ""; - const formattedPath = path ? (path.startsWith("/") ? path : `/${path}`) : ""; - return normalizeUrl(`${protocol}://${hostname}${formattedPort}${formattedPath}`); + return normalizeUrl(`${protocol}://${hostname}${port ? `:${port}` : ""}${path || ""}`); } // Create the language client with the given transports