Legend:
Library
Module
Module type
Parameter
Class
Class type
Library
Module
Module type
Parameter
Class
Class type
An easily overloadable class. Pick the methods you want to support. The user must provide at least the callbacks for document lifecycle: open, close, update. The most basic LSP server should check documents when they're updated and report diagnostics back to the editor.
inherit base_server
val docs : (Lsp.Types.DocumentUri.t, doc_state) Stdlib.Hashtbl.t
method find_doc : Lsp.Types.DocumentUri.t -> doc_state option
Find current state of the given document, if present.
method on_request_unhandled : 'r. 'r Lsp.Client_request.t -> 'r IO.t
Override to process other requests
method config_sync_opts : Lsp.Types.TextDocumentSyncOptions.t
Parameter for how to synchronize content with the editor
method on_req_initialize : Lsp.Types.InitializeParams.t ->
Lsp.Types.InitializeResult.t IO.t
method on_req_hover : uri:Lsp__Types.DocumentUri.t ->
pos:Lsp__Types.Position.t ->
doc_state ->
Lsp.Types.Hover.t option IO.t
Called when the user hovers on some identifier in the document
method on_req_completion : uri:Lsp__Types.DocumentUri.t ->
pos:Lsp__Types.Position.t ->
ctx:Lsp__Types.CompletionContext.t option ->
doc_state ->
[ `CompletionList of Lsp__.Types.CompletionList.t
| `List of Lsp__.Types.CompletionItem.t list ]
option
IO.t
Called when the user requests completion in the document
method on_req_definition : uri:Lsp__Types.DocumentUri.t ->
pos:Lsp__Types.Position.t ->
doc_state ->
Lsp.Types.Locations.t option IO.t
Called when the user wants to jump-to-definition
method on_request : 'a. 'a Lsp.Client_request.t -> 'a IO.t
method virtual on_notif_doc_did_open : notify_back:notify_back ->
Lsp.Types.TextDocumentItem.t ->
content:string ->
unit IO.t
Called when a document is opened
method virtual on_notif_doc_did_close : notify_back:notify_back ->
Lsp.Types.TextDocumentIdentifier.t ->
unit IO.t
method virtual on_notif_doc_did_change : notify_back:notify_back ->
Lsp.Types.VersionedTextDocumentIdentifier.t ->
Lsp.Types.TextDocumentContentChangeEvent.t list ->
old_content:string ->
new_content:string ->
unit IO.t
Called when the document changes.
method on_notification_unhandled : notify_back:
(Lsp.Server_notification.t -> unit IO.t) ->
Lsp.Client_notification.t ->
unit IO.t
Override to handle unprocessed notifications
method on_notification : notify_back:(Lsp.Server_notification.t -> unit IO.t) ->
Lsp.Client_notification.t ->
unit IO.t