This repository was archived by the owner on Oct 26, 2023. It is now read-only.
File tree 1 file changed +8
-3
lines changed
1 file changed +8
-3
lines changed Original file line number Diff line number Diff line change 4
4
"../msg-io.rkt " )
5
5
6
6
(define init-msg
7
- (hasheq 'id 0
7
+ (hasheq 'jsonrpc "2.0 "
8
+ 'id 0
8
9
'method "initialize "
9
10
'params (hasheq 'processId (getpid)
10
11
'rootPath "/home/conor/racket-langserver/ "
11
12
'rootUri "file:///home/conor/racket-langserver/ "
12
13
'capabilities (hasheq))))
13
14
14
15
(define shutdown-msg
15
- (hasheq 'id 1
16
+ (hasheq 'jsonrpc "2.0 "
17
+ 'id 1
16
18
'method "shutdown " ))
17
19
18
20
(define exit-notf
19
- (hasheq 'method "exit " ))
21
+ (hasheq 'jsonrpc "2.0 "
22
+ 'method "exit " ))
20
23
21
24
(define ((forward-errors in))
22
25
(for ([str (in-port read-line in)])
31
34
(display-message/flush init-msg stdin)
32
35
(let ([resp (read-message stdout)])
33
36
(chk*
37
+ (chk #:= (hash-ref resp 'jsonrpc ) "2.0 " )
34
38
(chk #:= (hash-ref init-msg 'id ) (hash-ref resp 'id ))
35
39
(chk (not (hash-ref resp 'error #f )))))
36
40
;; Shutdown request
37
41
(display-message/flush shutdown-msg stdin)
38
42
(let ([resp (read-message stdout)])
39
43
(chk*
44
+ (chk #:= (hash-ref resp 'jsonrpc ) "2.0 " )
40
45
(chk #:= (hash-ref shutdown-msg 'id ) (hash-ref resp 'id ))
41
46
(chk (not (hash-ref resp 'error #f )))))
42
47
;; Exit
You can’t perform that action at this time.
0 commit comments