Skip to content

Commit

Permalink
rename Cmt.fullFromPath to Cmt.loadFullCmtFromPath
Browse files Browse the repository at this point in the history
  • Loading branch information
aspeddro committed Nov 30, 2022
1 parent be67d21 commit 0f26053
Show file tree
Hide file tree
Showing 6 changed files with 12 additions and 12 deletions.
2 changes: 1 addition & 1 deletion analysis/src/Cmt.ml
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,6 @@ let fullFromModule ~package ~moduleName =
fullFromUri ~uri
else None

let fullFromPath ~path =
let loadFullCmtFromPath ~path =
let uri = Uri.fromPath path in
fullFromUri ~uri
12 changes: 6 additions & 6 deletions analysis/src/Commands.ml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ let getCompletions ~debug ~path ~pos ~currentFile ~forHover =
Printf.printf "Completable: %s\n"
(SharedTypes.Completable.toString completable);
(* Only perform expensive ast operations if there are completables *)
match Cmt.fullFromPath ~path with
match Cmt.loadFullCmtFromPath ~path with
| None -> []
| Some {file; package} ->
let env = SharedTypes.QueryEnv.fromFile file in
Expand Down Expand Up @@ -46,7 +46,7 @@ let codeLens ~path ~debug =

let hover ~path ~pos ~currentFile ~debug ~supportsMarkdownLinks =
let result =
match Cmt.fullFromPath ~path with
match Cmt.loadFullCmtFromPath ~path with
| None -> Protocol.null
| Some full -> (
match References.getLocItem ~full ~pos ~debug with
Expand Down Expand Up @@ -102,7 +102,7 @@ let codeAction ~path ~pos ~currentFile ~debug =

let definition ~path ~pos ~debug =
let locationOpt =
match Cmt.fullFromPath ~path with
match Cmt.loadFullCmtFromPath ~path with
| None -> None
| Some full -> (
match References.getLocItem ~full ~pos ~debug with
Expand Down Expand Up @@ -138,7 +138,7 @@ let definition ~path ~pos ~debug =

let typeDefinition ~path ~pos ~debug =
let maybeLocation =
match Cmt.fullFromPath ~path with
match Cmt.loadFullCmtFromPath ~path with
| None -> None
| Some full -> (
match References.getLocItem ~full ~pos ~debug with
Expand All @@ -157,7 +157,7 @@ let typeDefinition ~path ~pos ~debug =

let references ~path ~pos ~debug =
let allLocs =
match Cmt.fullFromPath ~path with
match Cmt.loadFullCmtFromPath ~path with
| None -> []
| Some full -> (
match References.getLocItem ~full ~pos ~debug with
Expand All @@ -183,7 +183,7 @@ let references ~path ~pos ~debug =

let rename ~path ~pos ~newName ~debug =
let result =
match Cmt.fullFromPath ~path with
match Cmt.loadFullCmtFromPath ~path with
| None -> Protocol.null
| Some full -> (
match References.getLocItem ~full ~pos ~debug with
Expand Down
4 changes: 2 additions & 2 deletions analysis/src/Hint.ml
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ let inlay ~path ~pos ~maxLength ~debug =
in
let {Res_driver.parsetree = structure} = parser ~filename:path in
iterator.structure iterator structure |> ignore);
match Cmt.fullFromPath ~path with
match Cmt.loadFullCmtFromPath ~path with
| None -> None
| Some full ->
let result =
Expand Down Expand Up @@ -141,7 +141,7 @@ let codeLens ~path ~debug =
in
let {Res_driver.parsetree = structure} = parser ~filename:path in
iterator.structure iterator structure |> ignore);
match Cmt.fullFromPath ~path with
match Cmt.loadFullCmtFromPath ~path with
| None -> None
| Some full ->
let result =
Expand Down
2 changes: 1 addition & 1 deletion analysis/src/Hover.ml
Original file line number Diff line number Diff line change
Expand Up @@ -133,7 +133,7 @@ let getHoverViaCompletions ~debug ~path ~pos ~currentFile ~forHover
Printf.printf "Completable: %s\n"
(SharedTypes.Completable.toString completable);
(* Only perform expensive ast operations if there are completables *)
match Cmt.fullFromPath ~path with
match Cmt.loadFullCmtFromPath ~path with
| None -> None
| Some {file; package} -> (
let env = SharedTypes.QueryEnv.fromFile file in
Expand Down
2 changes: 1 addition & 1 deletion analysis/src/SignatureHelp.ml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ let findFunctionType ~currentFile ~debug ~path ~pos =
with
| None -> None
| Some (completable, scope) -> (
match Cmt.fullFromPath ~path with
match Cmt.loadFullCmtFromPath ~path with
| None -> None
| Some {file; package} ->
let env = QueryEnv.fromFile file in
Expand Down
2 changes: 1 addition & 1 deletion analysis/src/Xform.ml
Original file line number Diff line number Diff line change
Expand Up @@ -301,7 +301,7 @@ let parse ~filename =
(structure, printExpr, printStructureItem)

let extractCodeActions ~path ~pos ~currentFile ~debug =
match Cmt.fullFromPath ~path with
match Cmt.loadFullCmtFromPath ~path with
| Some full when Files.classifySourceFile currentFile = Res ->
let structure, printExpr, printStructureItem =
parse ~filename:currentFile
Expand Down

0 comments on commit 0f26053

Please sign in to comment.