mirror of
https://github.com/c-cube/linol.git
synced 2025-12-06 11:15:46 -05:00
Support textDocument/didSave notification
This commit is contained in:
parent
d72988f63e
commit
74a9fc0dc5
1 changed files with 15 additions and 1 deletions
|
|
@ -531,6 +531,10 @@ module Make (IO : IO) = struct
|
|||
unit IO.t
|
||||
(** Called when the document changes. *)
|
||||
|
||||
method on_notif_doc_did_save ~notify_back:(_ : notify_back)
|
||||
(_params : DidSaveTextDocumentParams.t ) : unit IO.t =
|
||||
IO.return ()
|
||||
|
||||
method on_unknown_notification ~notify_back:(_ : notify_back)
|
||||
(_n : Jsonrpc.Notification.t) : unit IO.t =
|
||||
IO.return ()
|
||||
|
|
@ -637,10 +641,20 @@ module Make (IO : IO) = struct
|
|||
doc c
|
||||
~old_content:(Lsp.Text_document.text old_doc)
|
||||
~new_content:new_st.content)
|
||||
| Lsp.Client_notification.DidSaveTextDocument params ->
|
||||
let notify_back =
|
||||
new notify_back
|
||||
~workDoneToken:None ~partialResultToken:None ~uri:params.textDocument.uri
|
||||
~notify_back ~server_request ()
|
||||
in
|
||||
|
||||
async self (fun () ->
|
||||
self#on_notif_doc_did_save
|
||||
~notify_back:(notify_back : notify_back)
|
||||
params)
|
||||
| Lsp.Client_notification.Exit ->
|
||||
status <- `ReceivedExit;
|
||||
IO.return ()
|
||||
| Lsp.Client_notification.DidSaveTextDocument _
|
||||
| Lsp.Client_notification.WillSaveTextDocument _
|
||||
| Lsp.Client_notification.ChangeWorkspaceFolders _
|
||||
| Lsp.Client_notification.ChangeConfiguration _
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue