@@ -13,7 +13,7 @@ module J = {
13
13
14
14
open Infix ;
15
15
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) ;
17
17
18
18
let readMessage = (log, input) => {
19
19
let clength = input_line(input);
@@ -30,7 +30,7 @@ let readMessage = (log, input) => {
30
30
let json = try (Json . parse(raw)) {
31
31
| Failure (message ) => failwith ("Unable to parse message " ++ raw ++ " as json: " ++ message)
32
32
};
33
- let id = Json . get("id" , json) |?> Json . number ;
33
+ let id = Json . get("id" , json);
34
34
let method = Json . get("method" , json) |?> Json . string |! "method required" ;
35
35
let params = Json . get("params" , json) |! "params required" ;
36
36
switch id {
@@ -52,7 +52,7 @@ let sendMessage = (log, output, id, result) => {
52
52
open Json ;
53
53
open J ;
54
54
let content = Json . stringify(o([
55
- ("id" , Number (id) ),
55
+ ("id" , id ),
56
56
("jsonrpc" , s("2.0" )),
57
57
("result" , result)] ));
58
58
log("Sending response " ++ content);
@@ -63,7 +63,7 @@ let sendError = (log, output, id, error) => {
63
63
open Json ;
64
64
open J ;
65
65
let content = Json . stringify(o([
66
- ("id" , Number (id) ),
66
+ ("id" , id ),
67
67
("jsonrpc" , s("2.0" )),
68
68
("error" , error)] ));
69
69
log("Sending response " ++ content);
0 commit comments