@@ -13,11 +13,10 @@ let getCompletions ~debug ~path ~pos ~currentFile ~forHover =
13
13
Printf. printf " Completable: %s\n "
14
14
(SharedTypes.Completable. toString completable);
15
15
(* Only perform expensive ast operations if there are completables *)
16
- match Cmt. fromPath ~path with
16
+ match Cmt. fullFromPath ~path with
17
17
| None -> []
18
- | Some full ->
19
- let env = SharedTypes.QueryEnv. fromFile full.file in
20
- let package = full.package in
18
+ | Some {file; package} ->
19
+ let env = SharedTypes.QueryEnv. fromFile file in
21
20
completable
22
21
|> CompletionBackEnd. processCompletable ~debug ~package ~pos ~scope ~env
23
22
~for Hover))
@@ -31,9 +30,9 @@ let completion ~debug ~path ~pos ~currentFile =
31
30
32
31
let hover ~path ~line ~col ~currentFile ~debug =
33
32
let result =
34
- match Cmt. fromPath ~path with
33
+ match Cmt. fullFromPath ~path with
35
34
| None -> Protocol. null
36
- | Some ( {file} as full ) -> (
35
+ | Some full -> (
37
36
match References. getLocItem ~full ~line ~col with
38
37
| None -> (
39
38
if debug then
@@ -62,7 +61,7 @@ let hover ~path ~line ~col ~currentFile ~debug =
62
61
match uriLocOpt with
63
62
| None -> false
64
63
| Some (_ , loc ) ->
65
- let isInterface = file.uri |> Uri2. isInterface in
64
+ let isInterface = full. file.uri |> Uri2. isInterface in
66
65
let posIsZero {Lexing. pos_lnum; pos_bol; pos_cnum} =
67
66
(not isInterface) && pos_lnum = 1 && pos_cnum - pos_bol = 0
68
67
in
@@ -84,16 +83,16 @@ let codeAction ~path ~line ~col ~currentFile =
84
83
85
84
let definition ~path ~line ~col =
86
85
let locationOpt =
87
- match Cmt. fromPath ~path with
86
+ match Cmt. fullFromPath ~path with
88
87
| None -> None
89
- | Some ( {file} as full ) -> (
88
+ | Some full -> (
90
89
match References. getLocItem ~full ~line ~col with
91
90
| None -> None
92
91
| Some locItem -> (
93
92
match References. definitionForLocItem ~full locItem with
94
93
| None -> None
95
94
| Some (uri , loc ) ->
96
- let isInterface = file.uri |> Uri2. isInterface in
95
+ let isInterface = full. file.uri |> Uri2. isInterface in
97
96
let posIsZero {Lexing. pos_lnum; pos_bol; pos_cnum} =
98
97
(* range is zero *)
99
98
pos_lnum = 1 && pos_cnum - pos_bol = 0
@@ -122,7 +121,7 @@ let definition ~path ~line ~col =
122
121
123
122
let typeDefinition ~path ~line ~col =
124
123
let maybeLocation =
125
- match Cmt. fromPath ~path with
124
+ match Cmt. fullFromPath ~path with
126
125
| None -> None
127
126
| Some full -> (
128
127
match References. getLocItem ~full ~line ~col with
@@ -142,7 +141,7 @@ let typeDefinition ~path ~line ~col =
142
141
143
142
let references ~path ~line ~col =
144
143
let allLocs =
145
- match Cmt. fromPath ~path with
144
+ match Cmt. fullFromPath ~path with
146
145
| None -> []
147
146
| Some full -> (
148
147
match References. getLocItem ~full ~line ~col with
@@ -168,7 +167,7 @@ let references ~path ~line ~col =
168
167
169
168
let rename ~path ~line ~col ~newName =
170
169
let result =
171
- match Cmt. fromPath ~path with
170
+ match Cmt. fullFromPath ~path with
172
171
| None -> Protocol. null
173
172
| Some full -> (
174
173
match References. getLocItem ~full ~line ~col with
0 commit comments