Skip to content

Commit e414cb1

Browse files
committed
Serialize line and col as numbers, not strings
1 parent fa83d12 commit e414cb1

File tree

3 files changed

+4
-4
lines changed

3 files changed

+4
-4
lines changed

src/Protocol.ml

+1-1
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ type location = {
3333
}
3434

3535
let stringifyPosition p =
36-
Printf.sprintf {|{"line": "%i", "character": "%i"}|} p.line p.character
36+
Printf.sprintf {|{"line": %i, "character": %i}|} p.line p.character
3737

3838
let stringifyRange r =
3939
Printf.sprintf {|{"start": %s, "end": %s}|}

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)