@@ -13,11 +13,10 @@ let getCompletions ~debug ~path ~pos ~currentFile ~forHover =
1313 Printf. printf " Completable: %s\n "
1414 (SharedTypes.Completable. toString completable);
1515 (* Only perform expensive ast operations if there are completables *)
16- match Cmt. fromPath ~path with
16+ match Cmt. fullFromPath ~path with
1717 | 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
2120 completable
2221 |> CompletionBackEnd. processCompletable ~debug ~package ~pos ~scope ~env
2322 ~for Hover))
@@ -31,9 +30,9 @@ let completion ~debug ~path ~pos ~currentFile =
3130
3231let hover ~path ~line ~col ~currentFile ~debug =
3332 let result =
34- match Cmt. fromPath ~path with
33+ match Cmt. fullFromPath ~path with
3534 | None -> Protocol. null
36- | Some ( {file} as full ) -> (
35+ | Some full -> (
3736 match References. getLocItem ~full ~line ~col with
3837 | None -> (
3938 if debug then
@@ -62,7 +61,7 @@ let hover ~path ~line ~col ~currentFile ~debug =
6261 match uriLocOpt with
6362 | None -> false
6463 | Some (_ , loc ) ->
65- let isInterface = file.uri |> Uri2. isInterface in
64+ let isInterface = full. file.uri |> Uri2. isInterface in
6665 let posIsZero {Lexing. pos_lnum; pos_bol; pos_cnum} =
6766 (not isInterface) && pos_lnum = 1 && pos_cnum - pos_bol = 0
6867 in
@@ -84,16 +83,16 @@ let codeAction ~path ~line ~col ~currentFile =
8483
8584let definition ~path ~line ~col =
8685 let locationOpt =
87- match Cmt. fromPath ~path with
86+ match Cmt. fullFromPath ~path with
8887 | None -> None
89- | Some ( {file} as full ) -> (
88+ | Some full -> (
9089 match References. getLocItem ~full ~line ~col with
9190 | None -> None
9291 | Some locItem -> (
9392 match References. definitionForLocItem ~full locItem with
9493 | None -> None
9594 | Some (uri , loc ) ->
96- let isInterface = file.uri |> Uri2. isInterface in
95+ let isInterface = full. file.uri |> Uri2. isInterface in
9796 let posIsZero {Lexing. pos_lnum; pos_bol; pos_cnum} =
9897 (* range is zero *)
9998 pos_lnum = 1 && pos_cnum - pos_bol = 0
@@ -122,7 +121,7 @@ let definition ~path ~line ~col =
122121
123122let typeDefinition ~path ~line ~col =
124123 let maybeLocation =
125- match Cmt. fromPath ~path with
124+ match Cmt. fullFromPath ~path with
126125 | None -> None
127126 | Some full -> (
128127 match References. getLocItem ~full ~line ~col with
@@ -142,7 +141,7 @@ let typeDefinition ~path ~line ~col =
142141
143142let references ~path ~line ~col =
144143 let allLocs =
145- match Cmt. fromPath ~path with
144+ match Cmt. fullFromPath ~path with
146145 | None -> []
147146 | Some full -> (
148147 match References. getLocItem ~full ~line ~col with
@@ -168,7 +167,7 @@ let references ~path ~line ~col =
168167
169168let rename ~path ~line ~col ~newName =
170169 let result =
171- match Cmt. fromPath ~path with
170+ match Cmt. fullFromPath ~path with
172171 | None -> Protocol. null
173172 | Some full -> (
174173 match References. getLocItem ~full ~line ~col with
0 commit comments