ocamlformat icon indicating copy to clipboard operation
ocamlformat copied to clipboard

Feature request: Allow submodule-body indentations other than 2 spaces

Open ELLIOTTCABLE opened this issue 3 years ago • 7 comments

Is your feature request related to a problem? Please describe. At the moment, as far as I can tell, there's no way to reliably produce output like the following:

module Ex = struct
        type t
        (* ... *)
end

Unlike, for instance, extensions, functions, let-bindings, and type-decls, submodule bodies seem to be hard-coded to always be two spaces!

Describe the solution you'd like A indentation setting that applies to structs and signatures:

// .ocamlformat
extension-indent = 3
function-indent = 3
let-binding-indent = 3
type-decl-indent = 3

module-indent = 3

... producing, for the above:

module Ex = struct
   type t
   (* ... *)
end

ELLIOTTCABLE avatar Feb 27 '21 15:02 ELLIOTTCABLE