@@ -5,15 +5,13 @@ let dumpLocations ~package ~file ~extra =
5
5
in
6
6
locations
7
7
|> List. map (fun ((location : Location.t ), loc ) ->
8
- let hoverText =
9
- Hover. newHover ~file ~get Module:(State. fileForModule ~package ) loc
10
- in
8
+ let hoverText = Hover. newHover ~package ~file loc in
11
9
let hover =
12
10
match hoverText with None -> " " | Some s -> String. escaped s
13
11
in
14
12
let uriLocOpt =
15
13
References. definitionForLoc ~package ~file
16
- ~get Module:(State . fileForModule ~package )
14
+ ~get Module:(ProcessCmt . fileForModule ~package )
17
15
loc
18
16
in
19
17
let def =
@@ -33,7 +31,7 @@ let dump files =
33
31
|> List. iter (fun path ->
34
32
let uri = Uri2. fromLocalPath path in
35
33
let result =
36
- match State . getFullFromCmt ~uri with
34
+ match ProcessCmt . getFullFromCmt ~uri with
37
35
| Error message ->
38
36
prerr_endline message;
39
37
" []"
@@ -44,7 +42,7 @@ let dump files =
44
42
let complete ~path ~line ~col ~currentFile =
45
43
let uri = Uri2. fromLocalPath path in
46
44
let result =
47
- match State . getFullFromCmt ~uri with
45
+ match ProcessCmt . getFullFromCmt ~uri with
48
46
| Error message ->
49
47
prerr_endline message;
50
48
" []"
@@ -73,7 +71,7 @@ let hover ~file ~line ~col ~extra ~package =
73
71
in
74
72
let uriLocOpt =
75
73
References. definitionForLoc ~package ~file
76
- ~get Module:(State . fileForModule ~package )
74
+ ~get Module:(ProcessCmt . fileForModule ~package )
77
75
loc
78
76
in
79
77
let skipZero =
@@ -89,7 +87,7 @@ let hover ~file ~line ~col ~extra ~package =
89
87
if skipZero then Protocol. null
90
88
else
91
89
let hoverText =
92
- Hover. newHover ~file ~get Module:( State. fileForModule ~ package) loc
90
+ Hover. newHover ~file ~package loc
93
91
in
94
92
match hoverText with
95
93
| None -> Protocol. null
@@ -98,7 +96,7 @@ let hover ~file ~line ~col ~extra ~package =
98
96
let hover ~path ~line ~col =
99
97
let uri = Uri2. fromLocalPath path in
100
98
let result =
101
- match State . getFullFromCmt ~uri with
99
+ match ProcessCmt . getFullFromCmt ~uri with
102
100
| Error message -> Protocol. stringifyHover {contents = message}
103
101
| Ok (package , {file; extra} ) -> hover ~file ~line ~col ~extra ~package
104
102
in
@@ -121,7 +119,7 @@ let definition ~file ~line ~col ~extra ~package =
121
119
in
122
120
let uriLocOpt =
123
121
References. definitionForLoc ~package ~file
124
- ~get Module:(State . fileForModule ~package )
122
+ ~get Module:(ProcessCmt . fileForModule ~package )
125
123
loc
126
124
in
127
125
match uriLocOpt with
@@ -142,7 +140,7 @@ let definition ~file ~line ~col ~extra ~package =
142
140
let definition ~path ~line ~col =
143
141
let uri = Uri2. fromLocalPath path in
144
142
let result =
145
- match State . getFullFromCmt ~uri with
143
+ match ProcessCmt . getFullFromCmt ~uri with
146
144
| Error _message -> Protocol. null
147
145
| Ok (package , {file; extra} ) -> definition ~file ~line ~col ~extra ~package
148
146
in
@@ -161,9 +159,9 @@ let references ~file ~line ~col ~extra ~package =
161
159
| Some (_ , loc ) ->
162
160
let allReferences =
163
161
References. allReferencesForLoc ~package ~file ~extra
164
- ~all Modules:package.localModules ~get Uri:State . fileForUri
165
- ~get Module:(State . fileForModule ~package )
166
- ~get Extra:(State . extraForModule ~package )
162
+ ~all Modules:package.localModules ~get Uri:ProcessCmt . fileForUri
163
+ ~get Module:(ProcessCmt . fileForModule ~package )
164
+ ~get Extra:(ProcessCmt . extraForModule ~package )
167
165
loc
168
166
in
169
167
let allLocs =
@@ -185,7 +183,7 @@ let references ~file ~line ~col ~extra ~package =
185
183
let references ~path ~line ~col =
186
184
let uri = Uri2. fromLocalPath path in
187
185
let result =
188
- match State . getFullFromCmt ~uri with
186
+ match ProcessCmt . getFullFromCmt ~uri with
189
187
| Error _message -> Protocol. null
190
188
| Ok (package , {file; extra} ) -> references ~file ~line ~col ~extra ~package
191
189
in
0 commit comments