Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix ignorace of SOURCE_ROOT directive #1839

Merged
merged 1 commit into from
Sep 25, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions src/dot-merlin/dot_merlin_reader.ml
Original file line number Diff line number Diff line change
Expand Up @@ -426,6 +426,9 @@ let postprocess cfg =
cfg.stdlib
|> Option.map ~f:(fun stdlib -> `STDLIB stdlib)
|> Option.to_list;
cfg.source_root
|> Option.map ~f:(fun source_root -> `SOURCE_ROOT source_root)
|> Option.to_list;
List.concat_map pkg_paths ~f:(fun p -> [ `B p; `S p ]);
ppx;
List.map failures ~f:(fun s -> `ERROR_MSG s)
Expand Down
5 changes: 3 additions & 2 deletions tests/test-dirs/config/dot-merlin-reader/load-config.t
Original file line number Diff line number Diff line change
Expand Up @@ -6,12 +6,13 @@ This test comes from: https://github.com/janestreet/merlin-jst/pull/59
> BH build-hidden/dir
> SH source-hidden/dir
> STDLIB /stdlib
> SOURCE_ROOT /root
> EOF

$ FILE=$(pwd)/test.ml; dot-merlin-reader <<EOF | sed 's#[0-9]*:#?:#g'
> (4:File${#FILE}:$FILE)
> EOF
((?:B?:$TESTCASE_ROOT/build/dir)(?:S?:$TESTCASE_ROOT/source/dir)(?:BH?:$TESTCASE_ROOT/build-hidden/dir)(?:SH?:$TESTCASE_ROOT/source-hidden/dir)(?:STDLIB?:/stdlib))
((?:B?:$TESTCASE_ROOT/build/dir)(?:S?:$TESTCASE_ROOT/source/dir)(?:BH?:$TESTCASE_ROOT/build-hidden/dir)(?:SH?:$TESTCASE_ROOT/source-hidden/dir)(?:STDLIB?:/stdlib)(?:SOURCE_ROOT?:/root))

$ echo | $MERLIN single dump-configuration -filename test.ml 2> /dev/null | jq '.value.merlin'
{
Expand Down Expand Up @@ -43,7 +44,7 @@ This test comes from: https://github.com/janestreet/merlin-jst/pull/59
}
],
"stdlib": "/stdlib",
"source_root": null,
"source_root": "/root",
"unit_name": null,
"wrapping_prefix": null,
"reader": [],
Expand Down