Skip to content

Commit b17d62e

Browse files
committed
fix: validation for websocket url
1 parent 0edc2ea commit b17d62e

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

src/cm/lsp/serverRegistry.ts

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -154,8 +154,10 @@ function sanitizeDefinition(
154154
throw new Error(`LSP server ${id} (stdio) requires a command`);
155155
}
156156

157-
if (kind === "websocket" && !transport.url) {
158-
throw new Error(`LSP server ${id} (websocket) requires a url`);
157+
// Websocket transport requires a URL unless a bridge is configured for auto-port discovery
158+
const hasBridge = definition.launcher?.bridge?.command;
159+
if (kind === "websocket" && !transport.url && !hasBridge) {
160+
throw new Error(`LSP server ${id} (websocket) requires a url or a launcher bridge`);
159161
}
160162

161163
const transportOptions: Record<string, unknown> =

0 commit comments

Comments
 (0)