Skip to content
This repository was archived by the owner on Apr 24, 2021. It is now read-only.

Commit e32c1eb

Browse files
committed
Fix bad definition serialization
1 parent 0cc6159 commit e32c1eb

File tree

3 files changed

+5
-5
lines changed

3 files changed

+5
-5
lines changed

src/Protocol.ml

+2-2
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ let stringifyPosition p =
3636
Printf.sprintf {|{"line": "%i", "character": "%i"}|} p.line p.character
3737

3838
let stringifyRange r =
39-
Printf.sprintf {|{"start": "%s", "end": "%s"}|}
39+
Printf.sprintf {|{"start": %s, "end": %s}|}
4040
(stringifyPosition r.start)
4141
(stringifyPosition r.end_)
4242

@@ -63,7 +63,7 @@ let stringifyHover h =
6363
(String.escaped h.contents)
6464

6565
let stringifyLocation h =
66-
Printf.sprintf {|{"uri": "%s", "range": "%s"}|}
66+
Printf.sprintf {|{"uri": "%s", "range": %s}|}
6767
(String.escaped h.uri)
6868
(stringifyRange h.range)
6969

tests/src/expected/Definition.res.txt

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
Definition tests/src/Definition.res 2:8
2-
{"uri": "Definition.res", "range": "{"start": "{"line": "0", "character": "4"}", "end": "{"line": "0", "character": "6"}"}"}
2+
{"uri": "Definition.res", "range": {"start": {"line": "0", "character": "4"}, "end": {"line": "0", "character": "6"}}}
33

44
Definition tests/src/Definition.res 10:23
5-
{"uri": "Definition.res", "range": "{"start": "{"line": "6", "character": "7"}", "end": "{"line": "6", "character": "13"}"}"}
5+
{"uri": "Definition.res", "range": {"start": {"line": "6", "character": "7"}, "end": {"line": "6", "character": "13"}}}
66

77
Hover tests/src/Definition.res 14:14
88
{"contents": "```rescript\n('a => 'b, list<'a>) => list<'b>\n```\n\n`List.map f [a1; ...; an]` applies function `f` to `a1, ..., an`, and builds the list `[f a1; ...; f an]` with the results returned by `f`. Not tail-recursive.\n\n"}

tests/src/expected/Jsx.res.txt

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
Definition tests/src/Jsx.res 5:9
2-
{"uri": "Jsx.res", "range": "{"start": "{"line": "2", "character": "6"}", "end": "{"line": "2", "character": "10"}"}"}
2+
{"uri": "Jsx.res", "range": {"start": {"line": "2", "character": "6"}, "end": {"line": "2", "character": "10"}}}
33

44
Complete tests/src/Jsx.res 7:2
55
[]

0 commit comments

Comments
 (0)