I’m running into an odd bug, and I’m not sure how to go about further diagnosing it and fixing it.
In short, the presence of a .git
directory “breaks” the haskell language server.
I have a cabal project in a directory .../parent/project
with a cabal file project.cabal
. When a .git
directory is present in parent
(or an even further removed parent directory) , the haskell language server cannot find three specific packages that have been listed in the project.cabal
file. It can find all others. Additionally, if I remove all dependencies from the project.cabal
file, the haskell language server still recognizes all those other packages, all of which it no longer should. So it seems that the haskell language server is somehow not reading the cabal file. There is no other cabal file contained in any of the parent directories.
I should note that cabal run
and haskell-langauge-server-wrapper
both still work fine, its only the haskell language server as its initiated by eglot (in emacs) that breaks.
When I rename the .git
file to even just git
, suddenly haskell language server works properly again.
If I remove all the content of .git
so that it is an empty directory, the haskell language server still breaks.
If I create a new cabal project inside the directory parent
, same result.
I have tested this across two different machines, in different parent directories, etc. I have tested this with HLS 2.9.0.1 and 2.10.0.0. I have tested this with GHC 9.10.1 and GHC 9.12.2. The result is the same.
However, I have many other cabal projects residing in git repositories, all of them have the haskell language server working just fine. I cannot for the life of me see a difference between this git repository and any of the others.
Has anybody run into a similar issue or have an idea of how to go about debugging this?