Skip to content

Commit

Permalink
fix dump-dot-merlin
Browse files Browse the repository at this point in the history
Signed-off-by: Javier Chavarri <[email protected]>
  • Loading branch information
jchavarri committed Nov 24, 2022
1 parent 858dac6 commit c4a6d2b
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 1 deletion.
7 changes: 6 additions & 1 deletion src/dune_rules/merlin.ml
Original file line number Diff line number Diff line change
Expand Up @@ -131,7 +131,7 @@ module Processed = struct
if String.need_quoting s then Filename.quote s else s

let to_dot_merlin stdlib_dir pp_configs flags obj_dirs src_dirs extensions
(* TODO print melange flag *) _mode =
mode =
let b = Buffer.create 256 in
let printf = Printf.bprintf b in
let print = Buffer.add_string b in
Expand All @@ -156,6 +156,11 @@ module Processed = struct
print "# FLG";
List.iter flags ~f:(fun f -> printf " %s" (quote_for_dot_merlin f));
print "\n");
let () =
match mode with
| `Ocaml -> ()
| `Melange -> print "# FLG -ppx melc -as-ppx -bs-jsx 3\n"
in
Buffer.contents b

let get { modules; pp_config; config } ~filename =
Expand Down
8 changes: 8 additions & 0 deletions test/blackbox-tests/test-cases/melange/merlin.t
Original file line number Diff line number Diff line change
Expand Up @@ -49,3 +49,11 @@ The melange.emit entry contains a ppx directive

$ dune ocaml merlin dump-config $PWD | grep -i "ppx"
(FLG (-ppx "melc -as-ppx -bs-jsx 3"))

$ dune ocaml dump-dot-merlin $PWD
EXCLUDE_QUERY_DIR
STDLIB /home/me/code/dune/_opam/lib/melange
B $TESTCASE_ROOT/_build/default/.output.mobjs/melange
S $TESTCASE_ROOT
# FLG -w @[email protected]@30..39@[email protected]@[email protected]@67@69-40 -strict-sequence -strict-formats -short-paths -keep-locs
# FLG -ppx melc -as-ppx -bs-jsx 3

0 comments on commit c4a6d2b

Please sign in to comment.