From 11c4f36d025e65ce7accd5132eadd6d8113f5f8d Mon Sep 17 00:00:00 2001 From: Simon Cruanes Date: Thu, 8 Apr 2021 20:21:45 -0400 Subject: [PATCH] more debug info --- src/jsonrpc2.ml | 1 + src/server.ml | 4 +++- 2 files changed, 4 insertions(+), 1 deletion(-) 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 =