diff --git a/src/jsonrpc2.ml b/src/jsonrpc2.ml index aa578a70..e5245f88 100644 --- a/src/jsonrpc2.ml +++ b/src/jsonrpc2.ml @@ -144,6 +144,7 @@ module Make(IO : IO) try_ @@ fun () -> IO.return @@ J.from_string (Bytes.unsafe_to_string buf) in + Log.debug (fun k->k "got json %a" J.pp j); begin match Jsonrpc.Message.either_of_yojson j with | m -> IO.return @@ Ok m | exception _ -> diff --git a/src/server.ml b/src/server.ml index cb0d7094..968c2dd9 100644 --- a/src/server.ml +++ b/src/server.ml @@ -297,7 +297,9 @@ module Make(IO : IO) = struct | Lsp.Client_notification.TextDocumentDidChange {textDocument=doc; contentChanges=c} -> let notify_back = new notify_back ~uri:doc.uri ~notify_back () in begin match Hashtbl.find_opt docs doc.uri with - | None -> IO.failwith "unknown document" + | None -> + Log.err (fun k->k "unknown document: '%s'" doc.uri); + IO.failwith "unknown document" | Some st -> let old_content = st.content in let new_doc: Lsp.Text_document.t =