From 7b1070ef9fc4fcd8157c64c9761f0eca6c3aa230 Mon Sep 17 00:00:00 2001 From: Rudi Grinberg Date: Sun, 7 Jan 2024 16:27:25 -0700 Subject: [PATCH] fix: correctly output -open flags in merlin Use the same -open flags that are used for compilation Fixes #8297 Signed-off-by: Rudi Grinberg --- doc/changes/9659.md | 2 ++ src/dune_rules/merlin/merlin.ml | 2 +- .../test-cases/merlin/include-subdirs-qualified.t | 2 +- 3 files changed, 4 insertions(+), 2 deletions(-) create mode 100644 doc/changes/9659.md diff --git a/doc/changes/9659.md b/doc/changes/9659.md new file mode 100644 index 00000000000..f8ae3d027a6 --- /dev/null +++ b/doc/changes/9659.md @@ -0,0 +1,2 @@ +- Fix merlin configuration for `(include_subdirs qualified)` modules (#9659, + fixes #8297, @rgrinberg) diff --git a/src/dune_rules/merlin/merlin.ml b/src/dune_rules/merlin/merlin.ml index c4fe43528b5..c79399017a4 100644 --- a/src/dune_rules/merlin/merlin.ml +++ b/src/dune_rules/merlin/merlin.ml @@ -577,7 +577,7 @@ module Unprocessed = struct |> Path.Build.Set.fold ~init ~f:(fun src acc -> let config = { Processed.module_ = Module.set_pp m None - ; opens = Modules.alias_for modules m |> List.map ~f:Module.name + ; opens = Modules.local_open modules m } in (src, config) :: acc)) diff --git a/test/blackbox-tests/test-cases/merlin/include-subdirs-qualified.t b/test/blackbox-tests/test-cases/merlin/include-subdirs-qualified.t index 26d7b8d2074..9a1847ad0ac 100644 --- a/test/blackbox-tests/test-cases/merlin/include-subdirs-qualified.t +++ b/test/blackbox-tests/test-cases/merlin/include-subdirs-qualified.t @@ -149,7 +149,7 @@ $TESTCASE_ROOT/groupintf) (S $TESTCASE_ROOT/utils) - (FLG (-open Utils -open Foo)) + (FLG (-open Foo__Utils -open Foo)) (FLG (-w @1..3@5..28@30..39@43@46..47@49..57@61..62@67@69-40