Skip to content

Commit

Permalink
update utop
Browse files Browse the repository at this point in the history
Signed-off-by: Stephanie You <youstephanie98@gmail.com>
  • Loading branch information
stephanieyou committed Apr 7, 2020
1 parent 52e6fcf commit afe8f77
Showing 1 changed file with 7 additions and 5 deletions.
12 changes: 7 additions & 5 deletions src/dune/utop.ml
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ let source ~dir =

let is_utop_dir dir = Path.Build.basename dir = utop_dir_basename

let libs_under_dir sctx ~db ~dir =
let libs_and_ppx_under_dir sctx ~db ~dir =
(let open Option.O in
let* dir = Path.drop_build_context dir in
let+ dir = File_tree.find_dir dir in
Expand Down Expand Up @@ -63,11 +63,16 @@ let libs_under_dir sctx ~db ~dir =
| _ -> acc, pps )))
|> Option.value ~default:([], [])

let libs_under_dir sctx ~db ~dir = fst (libs_and_ppx_under_dir sctx ~db ~dir)

let setup sctx ~dir =
let expander = Super_context.expander sctx ~dir in
let scope = Super_context.find_scope_by_dir sctx dir in
let db = Scope.libs scope in
let libs, pps = libs_under_dir sctx ~db ~dir:(Path.build dir) in
let libs, pps = libs_and_ppx_under_dir sctx ~db ~dir:(Path.build dir) in
let source = source ~dir in
let obj_dir = Toplevel.Source.obj_dir source in
let loc = Toplevel.Source.loc source in
let pps =
if List.length pps = 0
then
Expand All @@ -80,9 +85,6 @@ let setup sctx ~dir =
~dep_kind:Required ~lib_name:None
~lint:Dune_file.Lint.no_lint ~preprocess ~preprocessor_deps:[]
in
let source = source ~dir in
let obj_dir = Toplevel.Source.obj_dir source in
let loc = Toplevel.Source.loc source in
let modules = Toplevel.Source.modules source preprocessing in
let requires =
let open Result.O in
Expand Down

0 comments on commit afe8f77

Please sign in to comment.