@@ -13,7 +13,7 @@ module J = {
1313
1414open Infix ;
1515
16- type jsonrpc = Message ( float , string, Json . t) | Notification ( string, Json . t) ;
16+ type jsonrpc = Message ( Json . t , string, Json . t) | Notification ( string, Json . t) ;
1717
1818let readMessage = (log, input) => {
1919 let clength = input_line(input);
@@ -30,7 +30,7 @@ let readMessage = (log, input) => {
3030 let json = try (Json . parse(raw)) {
3131 | Failure (message ) => failwith ("Unable to parse message " ++ raw ++ " as json: " ++ message)
3232 };
33- let id = Json . get("id" , json) |?> Json . number ;
33+ let id = Json . get("id" , json);
3434 let method = Json . get("method" , json) |?> Json . string |! "method required" ;
3535 let params = Json . get("params" , json) |! "params required" ;
3636 switch id {
@@ -52,7 +52,7 @@ let sendMessage = (log, output, id, result) => {
5252 open Json ;
5353 open J ;
5454 let content = Json . stringify(o([
55- ("id" , Number (id) ),
55+ ("id" , id ),
5656 ("jsonrpc" , s("2.0" )),
5757 ("result" , result)] ));
5858 log("Sending response " ++ content);
@@ -63,7 +63,7 @@ let sendError = (log, output, id, error) => {
6363 open Json ;
6464 open J ;
6565 let content = Json . stringify(o([
66- ("id" , Number (id) ),
66+ ("id" , id ),
6767 ("jsonrpc" , s("2.0" )),
6868 ("error" , error)] ));
6969 log("Sending response " ++ content);
0 commit comments