A possible solution to this problem is to manually add the _build
folder to the .merlin file in your project root directory. You will need to keep the build files of the external dependencies by doing opam install -b --deps-only
first, however.
See How to get merlin to do a good job on project dependencies? How to get dune to generate better .merlin files? for more details.