From 0d3bdf34fc195383e103d856a47d6546e859cdbe Mon Sep 17 00:00:00 2001 From: Rudi Grinberg Date: Wed, 30 May 2018 14:41:56 +0700 Subject: [PATCH] Small cleanup of merlin generation Use the the known src/obj dirs as the initial value for accumulation Signed-off-by: Rudi Grinberg --- src/merlin.ml | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/src/merlin.ml b/src/merlin.ml index 33016aba..f3d52427 100644 --- a/src/merlin.ml +++ b/src/merlin.ml @@ -127,19 +127,19 @@ let dot_merlin sctx ~dir ~scope ({ requires; flags; _ } as t) = flags >>^ (fun flags -> let (src_dirs, obj_dirs) = - Lib.Set.fold requires ~init:(Path.Set.empty, Path.Set.empty) - ~f:(fun (lib : Lib.t) (src_dirs, build_dirs) -> + Lib.Set.fold requires ~init:(t.source_dirs, t.objs_dirs) + ~f:(fun (lib : Lib.t) (src_dirs, obj_dirs) -> ( Path.Set.add src_dirs ( Lib.src_dir lib |> Path.drop_optional_build_context) - , Path.Set.add build_dirs (Lib.obj_dir lib))) + , Path.Set.add obj_dirs (Lib.obj_dir lib))) in Dot_file.to_string ~remaindir ~ppx:(ppx_flags sctx ~dir ~scope ~src_dir:remaindir t) ~flags - ~src_dirs:(Path.Set.union src_dirs t.source_dirs) - ~obj_dirs:(Path.Set.union obj_dirs t.objs_dirs)) + ~src_dirs + ~obj_dirs) >>> Build.write_file_dyn merlin_file)