LanguageServerPluginOptions
LanguageServerPluginOptions =
LanguageServerLaneHostOptions&object
Type Declaration
Section titled “Type Declaration”capabilities?
Section titled “capabilities?”
readonlyoptionalcapabilities?:lsp.ClientCapabilities
Merged over defaultClientCapabilities(), so a host declares only what it adds. Build a
semantic-tokens block with semanticTokensClientCapability() from @singapore-editor/lsp rather than
by hand: it refuses the flags this editor cannot honour, each of which a real server acts on.
clientInfo?
Section titled “clientInfo?”
readonlyoptionalclientInfo?:lsp.InitializeParams["clientInfo"]
At least one real server branches on this. The value is the host’s to pick.
connectionProvider?
Section titled “connectionProvider?”
readonlyoptionalconnectionProvider?:LspConnectionProvider
Borrows the connection rather than owning one per view, so a file switch that rebuilds the view
does not also rebuild the websocket and re-run initialize. The route and options above still
describe the connection — the provider is handed them and builds from them the first time it
sees a key. See LspConnectionProvider.
documentSync?
Section titled “documentSync?”
readonlyoptionaldocumentSync?:LanguageServerDocumentSyncOptions
Which documents reach the server, and under what language id.
getDiagnosticActions?
Section titled “getDiagnosticActions?”
readonlyoptionalgetDiagnosticActions?:LanguageServerDiagnosticActions
initializationOptions?
Section titled “initializationOptions?”
readonlyoptionalinitializationOptions?:unknown
notificationHandlers?
Section titled “notificationHandlers?”
readonlyoptionalnotificationHandlers?:Readonly<Record<string,LspNotificationHandler<LspClient>>>
Merged around the plugin’s own handlers. An entry for textDocument/publishDiagnostics runs
after the plugin’s and cannot displace it, because the diagnostics feature hangs off it.
onDefinitionLinkHover?
Section titled “onDefinitionLinkHover?”
readonlyoptionalonDefinitionLinkHover?: (target) =>void| (() =>void)
Reports the selected destination when Ctrl/Cmd-hover renders a jumpable link.
Parameters
Section titled “Parameters”target
Section titled “target”LanguageServerDefinitionTarget
Returns
Section titled “Returns”void | (() => void)
onDiagnostics?
Section titled “onDiagnostics?”
readonlyoptionalonDiagnostics?: (summary) =>void
Parameters
Section titled “Parameters”summary
Section titled “summary”LanguageServerDiagnosticSummary
Returns
Section titled “Returns”void
onDidNavigateDiagnostic?
Section titled “onDidNavigateDiagnostic?”
readonlyoptionalonDidNavigateDiagnostic?: (event) =>LanguageServerDiagnosticMarkerClaim
Parameters
Section titled “Parameters”LanguageServerDiagnosticMarkerEvent
Returns
Section titled “Returns”LanguageServerDiagnosticMarkerClaim
onError?
Section titled “onError?”
readonlyoptionalonError?: (error) =>void
Parameters
Section titled “Parameters”unknown
Returns
Section titled “Returns”void
onInteractiveReady?
Section titled “onInteractiveReady?”
readonlyoptionalonInteractiveReady?: () =>void
Returns
Section titled “Returns”void
onOpenDefinition?
Section titled “onOpenDefinition?”
readonlyoptionalonOpenDefinition?: (target,options?) =>void|boolean
Parameters
Section titled “Parameters”target
Section titled “target”LanguageServerDefinitionTarget
options?
Section titled “options?”LanguageServerNavigationOptions
Returns
Section titled “Returns”void | boolean
onOpenReferences?
Section titled “onOpenReferences?”
readonlyoptionalonOpenReferences?: (result) =>void|boolean
Parameters
Section titled “Parameters”result
Section titled “result”LanguageServerReferencesResult
Returns
Section titled “Returns”void | boolean
onRequestError?
Section titled “onRequestError?”
readonlyoptionalonRequestError?: (serverId,method,error) =>void
Parameters
Section titled “Parameters”serverId
Section titled “serverId”string
method
Section titled “method”string
unknown
Returns
Section titled “Returns”void
onStatusChange?
Section titled “onStatusChange?”
readonlyoptionalonStatusChange?: (status) =>void
Parameters
Section titled “Parameters”status
Section titled “status”Returns
Section titled “Returns”void
rootUri?
Section titled “rootUri?”
readonlyoptionalrootUri?:lsp.DocumentUri|null
semanticTokens?
Section titled “semanticTokens?”
readonlyoptionalsemanticTokens?:LanguageServerSemanticTokensOptions
Turns on the semantic token layer, and is how the host gets hold of one: a layer needs a
viewport, a snapshot and a lifecycle, so the contribution creates it and hands it over through
onLayer. Supplying nothing creates no layer and fires no demand signal.
serverRequestHandlers?
Section titled “serverRequestHandlers?”
readonlyoptionalserverRequestHandlers?:Readonly<Record<string,LspServerRequestHandler<LspClient>>>
Answers requests the server sends the client, such as a server asking the host for files.
A method the plugin answers itself (workspace/diagnostic/refresh) stays the plugin’s.
timeoutMs?
Section titled “timeoutMs?”
readonlyoptionaltimeoutMs?:number
webSocketRoute
Section titled “webSocketRoute”
readonlywebSocketRoute:string|URL
webSocketTransportOptions?
Section titled “webSocketTransportOptions?”
readonlyoptionalwebSocketTransportOptions?:LspWebSocketTransportOptions
onConnected()?
Section titled “onConnected()?”
optionalonConnected(context):void
The same context again, once initialize has come back and server capabilities are known.
Parameters
Section titled “Parameters”context
Section titled “context”LanguageServerConnectionContext
Returns
Section titled “Returns”void
onConnectionCreated()?
Section titled “onConnectionCreated()?”
optionalonConnectionCreated(context):void|EditorDisposable
Hands the host the connection the moment it exists, which is the only way to reach the
LspClient — and therefore the only way to issue a request, override the timeout for one, or
cancel one. Returning a disposable ties the host’s own controller to the connection’s life.
Parameters
Section titled “Parameters”context
Section titled “context”LanguageServerConnectionContext
Returns
Section titled “Returns”void | EditorDisposable