Skip to content

lspeasy / client/src / ClientOptions

Interface: ClientOptions<ClientCaps>

Defined in: packages/client/src/types.ts:38

Configuration for an LSPClient instance.

Remarks

Passed to the LSPClient constructor. All fields are optional; the client works with zero configuration.

Config

Type Parameters

Type ParameterDefault type
ClientCaps extends Partial<Transport>Transport

Properties

PropertyTypeDescriptionDefined in
capabilities?ClientCapsClient capabilities to advertisepackages/client/src/types.ts:54
dynamicRegistration?anyBehavior controls for server-driven dynamic registration.packages/client/src/types.ts:109
heartbeat?HeartbeatConfigOptional heartbeat configuration (disabled by default).packages/client/src/types.ts:104
initializationOptions?unknownArbitrary initialization options passed to the server in the initialize request's initializationOptions field. Remarks Used by the proxy path to tell the proxy daemon which backend language server to activate for this session (e.g. { languageId: 'typescript' }).packages/client/src/types.ts:124
logger?anyLogger instance for client loggingpackages/client/src/types.ts:77
logLevel?anyLog level for built-in console loggerpackages/client/src/types.ts:82
middleware?any[]Optional middleware chain for clientToServer/serverToClient messages.packages/client/src/types.ts:99
name?stringClient identification (sent in initialize request)packages/client/src/types.ts:44
onValidationError?(error, response) => voidCallback for response validation errorspackages/client/src/types.ts:114
requestTimeout?numberDefault request timeout in milliseconds for outgoing requestspackages/client/src/types.ts:87
rootUri?string | nullWorkspace root URI sent in the initialize request (rootUri). Defaults to null. Although rootUri is deprecated in the LSP spec in favour of workspaceFolders, many servers (e.g. typescript-language-server) still read it to locate the project root, so set it for reliable indexing.packages/client/src/types.ts:63
strictCapabilities?booleanStrict capability checking mode When true, throws error if handler registered or request sent for unsupported capability When false, logs warning and allows registration/sending (default: false)packages/client/src/types.ts:94
version?stringClient versionpackages/client/src/types.ts:49
workspaceFolders?| { name: string; uri: string; }[] | nullWorkspace folders sent in the initialize request. The modern replacement for rootUri. When omitted and rootUri is set, the client does not synthesize folders — pass them explicitly if the server relies on workspaceFolders.packages/client/src/types.ts:72

Released under the MIT License.