1- let dumpLocations ~package ~ file ~ extra : { SharedTypes. locItems} =
2- locItems
1+ let dumpLocations ~full =
2+ full. SharedTypes. extra. locItems
33 |> List. map (fun locItem ->
4- let hoverText = Hover. newHover ~package ~file locItem in
4+ let hoverText = Hover. newHover ~full locItem in
55 let hover =
66 match hoverText with None -> " " | Some s -> String. escaped s
77 in
8- let uriLocOpt =
9- References. definitionForLocItem ~package ~file locItem
10- in
8+ let uriLocOpt = References. definitionForLocItem ~full locItem in
119 let def =
1210 match uriLocOpt with
1311 | None -> Protocol. null
@@ -27,7 +25,7 @@ let dump files =
2725 let result =
2826 match ProcessCmt. getFullFromCmt ~uri with
2927 | None -> " []"
30- | Some {package; file; extra} -> dumpLocations ~package ~file ~extra
28+ | Some full -> dumpLocations ~full
3129 in
3230 print_endline result)
3331
@@ -49,7 +47,7 @@ let hover ~path ~line ~col =
4947 let result =
5048 match ProcessCmt. getFullFromCmt ~uri with
5149 | None -> Protocol. null
52- | Some {package; file; extra} -> (
50+ | Some ( { file; extra} as full ) -> (
5351 let pos = Utils. protocolLineColToCmtLoc ~line ~col in
5452 match References. locItemForPos ~extra pos with
5553 | None -> Protocol. null
@@ -59,9 +57,7 @@ let hover ~path ~line ~col =
5957 | SharedTypes. LModule _ | TopLevelModule _ -> true
6058 | TypeDefinition _ | Typed _ | Constant _ -> false
6159 in
62- let uriLocOpt =
63- References. definitionForLocItem ~package ~file locItem
64- in
60+ let uriLocOpt = References. definitionForLocItem ~full locItem in
6561 let skipZero =
6662 match uriLocOpt with
6763 | None -> false
@@ -75,7 +71,7 @@ let hover ~path ~line ~col =
7571 in
7672 if skipZero then Protocol. null
7773 else
78- let hoverText = Hover. newHover ~file ~package locItem in
74+ let hoverText = Hover. newHover ~full locItem in
7975 match hoverText with
8076 | None -> Protocol. null
8177 | Some s -> Protocol. stringifyHover {contents = s}))
@@ -87,7 +83,7 @@ let definition ~path ~line ~col =
8783 let result =
8884 match ProcessCmt. getFullFromCmt ~uri with
8985 | None -> Protocol. null
90- | Some {package; file; extra} -> (
86+ | Some ( { file; extra} as full ) -> (
9187 let pos = Utils. protocolLineColToCmtLoc ~line ~col in
9288
9389 match References. locItemForPos ~extra pos with
@@ -98,9 +94,7 @@ let definition ~path ~line ~col =
9894 | SharedTypes. LModule _ | TopLevelModule _ -> true
9995 | TypeDefinition _ | Typed _ | Constant _ -> false
10096 in
101- let uriLocOpt =
102- References. definitionForLocItem ~package ~file locItem
103- in
97+ let uriLocOpt = References. definitionForLocItem ~full locItem in
10498 match uriLocOpt with
10599 | None -> Protocol. null
106100 | Some (uri2 , loc ) ->
0 commit comments