diff --git a/ocaml-lsp-server/src/custom_requests/req_type_enclosing.ml b/ocaml-lsp-server/src/custom_requests/req_type_enclosing.ml index 89ed6f749..c77de4614 100644 --- a/ocaml-lsp-server/src/custom_requests/req_type_enclosing.ml +++ b/ocaml-lsp-server/src/custom_requests/req_type_enclosing.ml @@ -103,8 +103,7 @@ let make_enclosing_command position index = Query_protocol.Type_enclosing (None, position, Some index) let get_first_enclosing_index range_end enclosings = - List.find_mapi - ~f:(fun i (loc, _, _) -> + List.find_mapi enclosings ~f:(fun i (loc, _, _) -> let range = Range.of_loc loc in match ( Position.compare range_end range.start @@ -119,7 +118,6 @@ let get_first_enclosing_index range_end enclosings = | Ordering.Lt, Ordering.Eq | Ordering.Lt, Ordering.Gt | Ordering.Eq, Ordering.Gt -> None) - enclosings let dispatch_command pipeline command first_index index = let rec aux i acc = function diff --git a/ocaml-lsp-server/src/import.ml b/ocaml-lsp-server/src/import.ml index 302aba243..a59c65e6a 100644 --- a/ocaml-lsp-server/src/import.ml +++ b/ocaml-lsp-server/src/import.ml @@ -28,6 +28,8 @@ include struct let findi xs ~f = List.findi xs ~f + let find_mapi xs ~f = find_mapi xs ~f + let sub xs ~pos ~len = List.sub xs ~pos ~len let hd_exn t = List.hd_exn t