diff --git a/.git-blame-ignore-revs b/.git-blame-ignore-revs index ff5a01ab15..e3fa0f2aee 100644 --- a/.git-blame-ignore-revs +++ b/.git-blame-ignore-revs @@ -6,3 +6,7 @@ c5b7900eb40a48e2877db4994a2b2f8d755531e4 8b4a11d74af7dd4de0ae9463af3c9d563d758cfc # ocamlformat 0.25.1 0f01f32f3b3adc849bc7cc859776763a9139da19 +# Upgrade to OCamlformat 0.26.0 +1cf80035f66badcc8b4e667cbfd13cb483a7a773 +# Upgrade to OCamlformat 0.26.1 +1c015488b8d32a0571eaa144a92ab4725bad0b85 diff --git a/.ocamlformat b/.ocamlformat index 33d067bf7e..5626d8362a 100644 --- a/.ocamlformat +++ b/.ocamlformat @@ -1,2 +1,3 @@ module-item-spacing=preserve -version=0.25.1 +version=0.26.1 +ocaml-version=4.02 diff --git a/doc/examples/markup.mli b/doc/examples/markup.mli index 5766cb69a5..fb05709a19 100644 --- a/doc/examples/markup.mli +++ b/doc/examples/markup.mli @@ -52,46 +52,42 @@ module type Foo = sig val bar : string (** This comment is associated to bar. *) - class cl : - object - - (** Interesting information about cl *) - end + class cl : object + (** Interesting information about cl *) + end (** The comment for class my_class *) - class my_class : - object - inherit cl - (** A comment to describe inheritance from cl *) + class my_class : object + inherit cl + (** A comment to describe inheritance from cl *) - val mutable tutu : string - (** The comment for attribute tutu *) + val mutable tutu : string + (** The comment for attribute tutu *) - val toto : int - (** The comment for attribute toto. *) + val toto : int + (** The comment for attribute toto. *) - (** This comment is not attached to titi since + (** This comment is not attached to titi since there is a blank line before titi, but is kept as a comment in the class. *) - val titi : string + val titi : string - method toto : string - (** Comment for method toto *) + method toto : string + (** Comment for method toto *) - method m : float -> int - (** Comment for method m *) - end + method m : float -> int + (** Comment for method m *) + end (** The comment for the class type my_class_type *) - class type my_class_type = - object - val mutable x : int - (** The comment for variable x. *) + class type my_class_type = object + val mutable x : int + (** The comment for variable x. *) - method m : int -> int - (** The comment for method m. *) - end + method m : int -> int + (** The comment for method m. *) + end (** The comment for module Foo *) module Foo : sig @@ -119,16 +115,15 @@ end module Stop : sig (** This module demonstrates the use of stop comments ([(**/**)]) *) - class type foo = - object - method m : string - (** comment for method m *) + class type foo = object + method m : string + (** comment for method m *) - (**/**) + (**/**) - method bar : int - (** This method won't appear in the documentation *) - end + method bar : int + (** This method won't appear in the documentation *) + end val foo : string (** This value appears in the documentation, since the Stop special comment diff --git a/src/ocamlary/ocamlary.mli b/src/ocamlary/ocamlary.mli index b2981ef8ba..f5a8de70bd 100644 --- a/src/ocamlary/ocamlary.mli +++ b/src/ocamlary/ocamlary.mli @@ -579,23 +579,19 @@ type my_mod = (module COLLECTION) class empty_class : object end -class one_method_class : - object - method go : unit - end +class one_method_class : object + method go : unit +end -class two_method_class : - object - method one : one_method_class +class two_method_class : object + method one : one_method_class - method undo : unit - end + method undo : unit +end -class ['a] param_class : - 'a - -> object - method v : 'a - end +class ['a] param_class : 'a -> object + method v : 'a +end type my_unit_object = unit param_class @@ -609,10 +605,9 @@ type 'a my_unit_class = unit #param_class as 'a (* Test resolution of dependently typed modules *) module Dep1 : sig module type S = sig - class c : - object - method m : int - end + class c : object + method m : int + end end module X : sig @@ -726,10 +721,9 @@ module type Dep10 = Dep9(Dep8).T with type t = int module Dep11 : sig module type S = sig - class c : - object - method m : int - end + class c : object + method m : int + end end end diff --git a/src/xref2/env.ml b/src/xref2/env.ml index a0cb34a970..c5da7d79ae 100644 --- a/src/xref2/env.ml +++ b/src/xref2/env.ml @@ -523,15 +523,14 @@ let s_module : Component.Element.module_ scope = let s_any : Component.Element.any scope = make_scope ~root:lookup_page_or_root_module_fallback - ~check: - (fun env -> function - | `Label (id, _) -> ( - try - Some - (Identifier.Maps.Label.find id env.ambiguous_labels - :> Component.Element.any amb_err) - with Not_found -> None) - | _ -> None) + ~check:(fun env -> function + | `Label (id, _) -> ( + try + Some + (Identifier.Maps.Label.find id env.ambiguous_labels + :> Component.Element.any amb_err) + with Not_found -> None) + | _ -> None) (function (* Reference to [A] could refer to [extension-A] or [extension-decl-A]. The legacy behavior refers to the constructor [extension-A]. *) @@ -562,11 +561,10 @@ let s_value : Component.Element.value scope = let s_label : Component.Element.label scope = make_scope - ~check: - (fun env -> function - | `Label (id, _) -> ( - try Some (Identifier.Maps.Label.find id env.ambiguous_labels) - with Not_found -> None)) + ~check:(fun env -> function + | `Label (id, _) -> ( + try Some (Identifier.Maps.Label.find id env.ambiguous_labels) + with Not_found -> None)) (function #Component.Element.label as r -> Some r | _ -> None) let s_constructor : Component.Element.constructor scope = diff --git a/src/xref2/ref_tools.ml b/src/xref2/ref_tools.ml index e838726abb..850f82982f 100644 --- a/src/xref2/ref_tools.ml +++ b/src/xref2/ref_tools.ml @@ -349,7 +349,7 @@ module L = struct | `Heading ( _, ({ Odoc_model.Paths.Identifier.iv = `Label (_, name'); _ } as - label), + label), _ ) when name = LabelName.to_string name' -> Ok (`Identifier label)