Module Migrate_utilsSource

Sourcetype state
Sourcemodule Occ : sig ... end

Manage occurrences of identifiers that should be migrated.

Sourceval add_comment : state -> ?loc:Ocamlformat_utils.Parsing.Location.t -> string -> unit

Add comments in the output. Comments are attached to a location that must appear in the output AST and cannot be a ghost location. If loc is None, use the location set with set_default_comment_loc instead.

Sourceval set_default_comment_loc : state -> Ocamlformat_utils.Parsing.Location.t -> unit

Set the default location for comments added with add_comment.

Sourcetype modify_ast = {
  1. structure : state -> Ocamlformat_utils.Parsing.Parsetree.structure -> Ocamlformat_utils.Parsing.Parsetree.structure;
  2. signature : state -> Ocamlformat_utils.Parsing.Parsetree.signature -> Ocamlformat_utils.Parsing.Parsetree.signature;
}
Sourceval migrate : packages:string list -> units:(string -> bool) -> modify_ast:(fname:string -> modify_ast) -> (unit, [ `Msg of string ]) result

Modify files containing occurrences to modules matched by units of packages packages using modify_ast. Will scan file in _build and in the current directory.

Sourceval print_occurrences : packages:string list -> units:(string -> bool) -> (unit, [ `Msg of string ]) result

Print occurrences that would be rewritten by migrate.