I am glad to announce, on behalf of the Merlin team, the release of Merlin
3.4.0 which brings some major changes in the way configuration is handled.
As you might know, Merlin reads its configuration from the closest
.merlin file to the source file being edited. These files tell merlin where to find other source files and build artifacts, but also which flags should be passed to the compiler, which syntax extensions are enabled and which packages are used by the project.
In this setting the configuration is the same for all the source files of a folder, regardless of their specificities. In other words, the configuration loaded for a single source file contains the union of the dependencies of this file and of all its siblings which is not an optimal behavior.
Starting with version
3.4.0 merlin will ship with two packages:
dot-merlin-reader which, as the name suggests, reads configuration from
.merlin files. Both are necessary for proper function.
.merlin file is present in the source folder the Merlin server will start a
dot-merlin-reader process and communicate with it via standard input and output following a simple protocol. These processes are halted with the server.
This change should not have any visible impact on users’ workflows as long as the
dot-merlin-reader binary is correctly installed and in the path. (which should be the case in opam-based setups)
This change in itself will not solve the granularity problem mentioned earlier, but it paves the way for such improvements: in a near-future Dune will stop generating
.merlin files and Merlin will obtain file-based configuration directly from the build system using the same protocol as the one used by
- merlin binary
- fix completion of pattern matchings with exception patterns (#1169)
- delegate configuration reading to external programs via a simple protocol
and create a new package
dot-merlin-readerwith a binary that reads
.merlinfiles. (#1123, #1152)