1
- let dumpLocations ~package ~ file ~ extra : { SharedTypes. locItems} =
2
- locItems
1
+ let dumpLocations ~full =
2
+ full. SharedTypes. extra. locItems
3
3
|> List. map (fun locItem ->
4
- let hoverText = Hover. newHover ~package ~file locItem in
4
+ let hoverText = Hover. newHover ~full locItem in
5
5
let hover =
6
6
match hoverText with None -> " " | Some s -> String. escaped s
7
7
in
8
- let uriLocOpt =
9
- References. definitionForLocItem ~package ~file locItem
10
- in
8
+ let uriLocOpt = References. definitionForLocItem ~full locItem in
11
9
let def =
12
10
match uriLocOpt with
13
11
| None -> Protocol. null
@@ -27,7 +25,7 @@ let dump files =
27
25
let result =
28
26
match ProcessCmt. getFullFromCmt ~uri with
29
27
| None -> " []"
30
- | Some {package; file; extra} -> dumpLocations ~package ~file ~extra
28
+ | Some full -> dumpLocations ~full
31
29
in
32
30
print_endline result)
33
31
@@ -49,7 +47,7 @@ let hover ~path ~line ~col =
49
47
let result =
50
48
match ProcessCmt. getFullFromCmt ~uri with
51
49
| None -> Protocol. null
52
- | Some {package; file; extra} -> (
50
+ | Some ( { file; extra} as full ) -> (
53
51
let pos = Utils. protocolLineColToCmtLoc ~line ~col in
54
52
match References. locItemForPos ~extra pos with
55
53
| None -> Protocol. null
@@ -59,9 +57,7 @@ let hover ~path ~line ~col =
59
57
| SharedTypes. LModule _ | TopLevelModule _ -> true
60
58
| TypeDefinition _ | Typed _ | Constant _ -> false
61
59
in
62
- let uriLocOpt =
63
- References. definitionForLocItem ~package ~file locItem
64
- in
60
+ let uriLocOpt = References. definitionForLocItem ~full locItem in
65
61
let skipZero =
66
62
match uriLocOpt with
67
63
| None -> false
@@ -75,7 +71,7 @@ let hover ~path ~line ~col =
75
71
in
76
72
if skipZero then Protocol. null
77
73
else
78
- let hoverText = Hover. newHover ~file ~package locItem in
74
+ let hoverText = Hover. newHover ~full locItem in
79
75
match hoverText with
80
76
| None -> Protocol. null
81
77
| Some s -> Protocol. stringifyHover {contents = s}))
@@ -87,7 +83,7 @@ let definition ~path ~line ~col =
87
83
let result =
88
84
match ProcessCmt. getFullFromCmt ~uri with
89
85
| None -> Protocol. null
90
- | Some {package; file; extra} -> (
86
+ | Some ( { file; extra} as full ) -> (
91
87
let pos = Utils. protocolLineColToCmtLoc ~line ~col in
92
88
93
89
match References. locItemForPos ~extra pos with
@@ -98,9 +94,7 @@ let definition ~path ~line ~col =
98
94
| SharedTypes. LModule _ | TopLevelModule _ -> true
99
95
| TypeDefinition _ | Typed _ | Constant _ -> false
100
96
in
101
- let uriLocOpt =
102
- References. definitionForLocItem ~package ~file locItem
103
- in
97
+ let uriLocOpt = References. definitionForLocItem ~full locItem in
104
98
match uriLocOpt with
105
99
| None -> Protocol. null
106
100
| Some (uri2 , loc ) ->
0 commit comments