LSP client pops an error dialog on every .bel open (starts against the unimplemented stub) #58

Open
opened 2026-07-04 18:09:18 +00:00 by toph · 0 comments
Owner

Opening any .bel file pops a modal error dialog ("Beloch Language Server client: couldn't create connection to server") plus five error lines in the output channel, because the extension starts a LanguageClient against beloch lsp — which is still an unimplemented stub that exits 1 immediately.

The foundation tried to make this graceful via errorHandler returning handled: true and client.start().catch(...). But LanguageClient.start()'s initialization-failure path calls showErrorMessage directly, bypassing clientOptions.errorHandler — so handled: true does not suppress it, and .catch() only swallows the promise rejection, not the dialog.

Root fix: don't start the LSP client at all while the server is a stub. The LSP subsystem slice wires up the client once beloch lsp is a real server.

Fixed on the vscode-preview branch (see #53) in editors/vscode/src/lsp.tsregisterLsp no longer calls client.start(); the client-bootstrap seam is kept in a startClient helper for the LSP slice. Reaches main when #53 merges.

Found while dogfooding the live preview.

Opening any `.bel` file pops a modal error dialog ("Beloch Language Server client: couldn't create connection to server") plus five error lines in the output channel, because the extension starts a `LanguageClient` against `beloch lsp` — which is still an unimplemented stub that exits 1 immediately. The foundation tried to make this graceful via `errorHandler` returning `handled: true` and `client.start().catch(...)`. But `LanguageClient.start()`'s initialization-failure path calls `showErrorMessage` directly, bypassing `clientOptions.errorHandler` — so `handled: true` does not suppress it, and `.catch()` only swallows the promise rejection, not the dialog. Root fix: don't start the LSP client at all while the server is a stub. The LSP subsystem slice wires up the client once `beloch lsp` is a real server. Fixed on the `vscode-preview` branch (see #53) in `editors/vscode/src/lsp.ts` — `registerLsp` no longer calls `client.start()`; the client-bootstrap seam is kept in a `startClient` helper for the LSP slice. Reaches `main` when #53 merges. Found while dogfooding the live preview.
Sign in to join this conversation.
No labels
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
toph/beloch#58
No description provided.