This repository was archived by the owner on Apr 24, 2021. It is now read-only.
File tree Expand file tree Collapse file tree 2 files changed +5
-7
lines changed Expand file tree Collapse file tree 2 files changed +5
-7
lines changed Original file line number Diff line number Diff line change @@ -15,8 +15,8 @@ let dumpLocations state ~package ~file ~extra ~selectPos uri =
15
15
in
16
16
let locations =
17
17
match selectPos with
18
- | Some pos -> (
19
- let pos = Utils. cmtLocFromVscode pos in
18
+ | Some ( line , col ) -> (
19
+ let pos = Utils. protocolLineColToCmtLoc ~line ~col in
20
20
match References. locForPos ~extra: {extra with locations} pos with
21
21
| None -> []
22
22
| Some l -> [l])
@@ -130,8 +130,7 @@ let hover state ~file ~line ~col ~extra ~package =
130
130
|> List. filter (fun (l , _ ) -> not l.Location. loc_ghost)
131
131
in
132
132
let locations =
133
- let pos = (line, col) in
134
- let pos = Utils. cmtLocFromVscode pos in
133
+ let pos = Utils. protocolLineColToCmtLoc ~line ~col in
135
134
match References. locForPos ~extra: {extra with locations} pos with
136
135
| None -> []
137
136
| Some l -> [l]
@@ -200,8 +199,7 @@ let definition state ~file ~line ~col ~extra ~package =
200
199
|> List. filter (fun (l , _ ) -> not l.Location. loc_ghost)
201
200
in
202
201
let locations =
203
- let pos = (line, col) in
204
- let pos = Utils. cmtLocFromVscode pos in
202
+ let pos = Utils. protocolLineColToCmtLoc ~line ~col in
205
203
match References. locForPos ~extra: {extra with locations} pos with
206
204
| None -> []
207
205
| Some l -> [l]
Original file line number Diff line number Diff line change @@ -39,7 +39,7 @@ let endsWith s suffix =
39
39
let l = String. length s in
40
40
p < = String. length s && String. sub s (l - p) p = suffix
41
41
42
- let cmtLocFromVscode ( line , col ) = (line + 1 , col)
42
+ let protocolLineColToCmtLoc ~ line ~ col = (line + 1 , col)
43
43
44
44
let cmtLocToPosition {Lexing. pos_lnum; pos_cnum; pos_bol} = Protocol. {
45
45
line = pos_lnum - 1 ;
You can’t perform that action at this time.
0 commit comments