Skip to content

LspConnectionOptions

LspConnectionOptions = object

readonly optional capabilities?: lsp.ClientCapabilities

Merged over defaultClientCapabilities() by the client itself, so a host declares only what it adds. This is how a host turns on a feature the defaults deliberately leave off — textDocument.semanticTokens among them, which no server sends without being asked.


readonly optional clientInfo?: lsp.InitializeParams["clientInfo"]

Load-bearing rather than cosmetic: at least one real server branches on the client name and withholds a request from clients it does not recognise. The value is the host’s to pick.


readonly initializationOptions: unknown


readonly optional notificationHandlers?: Readonly<Record<string, LspNotificationHandler<LspClient>>>

Merged around the connection’s own handlers rather than replacing them. See createClient.


readonly optional reconnect?: LspReconnectOptions

Reconnects a transport that closed or failed on its own. Absent, the first loss is final.


readonly rootUri: lsp.DocumentUri | null


readonly optional serverRequestHandlers?: Readonly<Record<string, LspServerRequestHandler<LspClient>>>

Answers the server’s requests; the connection’s own workspace/diagnostic/refresh stays its.


readonly timeoutMs: number

createTransport(): LspManagedTransport | Promise<LspManagedTransport>

LspManagedTransport | Promise<LspManagedTransport>