merlin icon indicating copy to clipboard operation
merlin copied to clipboard

[BUG] Running `ocamlmerlin-server.exe` does not allow moving directory under Windows

Open nojb opened this issue 2 years ago • 3 comments

After one starts using merlin to edit a file on Emacs under Windows it is not possible to move the containing directory around, which is quite inconvenient. Closing emacs does not solve the problem because the merlin process continues to run in the background. The only solution is to kill the merlin process running in the background.

image

  • Why not shut down the merlin background process when closing Emacs?
  • Typically this problems happens because a program (Merlin in this case) keeps open handles to the directory or some file within it; if this is indeed the case, perhaps this situation can be avoided? For example even if one is editing a file in a directory with Emacs, that does not keep the containing directory from being renamed.

To reproduce

  1. mkdir foo
  2. emacs foo/foo.ml
  3. Perform some operation that invokes merlin on the foo.ml buffer
  4. mv foo foo2 in the terminal (fails)

nojb avatar May 31 '22 15:05 nojb

Also, am not sure if the problem is the merlin server process or the Dune process that is started in the background (or both).

nojb avatar May 31 '22 15:05 nojb

I did some more digging: it seems the problem is the ocamlmerlin-server.exe process which keeps an open handle to the directory where the file being edited is found.

nojb avatar Jun 28 '22 06:06 nojb

@let-def ?

voodoos avatar Jun 29 '22 09:06 voodoos

This will be fixed in #1569

nojb avatar Feb 21 '23 16:02 nojb