haskell / haskell-language-server

Official haskell ide support via language server (LSP). Successor of ghcide & haskell-ide-engine.
Apache License 2.0
2.65k stars 354 forks source link

Support the same project checked out in different directories #4215

Open coot opened 4 months ago

coot commented 4 months ago

It seems that HLS can get confused when working on the same project cloned in different directories. When I had to work using such a setup, there was only one entry in ~/.cache/hie-bios/dist-<project>-<hash>.

fendor commented 4 months ago

How are the projects cloned? The <project> part is the name of the directory, so if you have cloned them into different directories, it should result in a different directory.

Can you reproduce the issue with solely hie-bios, or what issue are you encountering?

michaelpj commented 4 months ago

Could we just include the canonical path as an input into the hash?

fendor commented 4 months ago

Could we just include the canonical path as an input into the hash?

We do in hie-bios, hence my questions.

coot commented 4 months ago

I cloned the same repository (with multiple cabal packages) in two different directories using git clone, yet there was only one cache entry.

fendor commented 4 months ago

Please provide instructions, I checked locally with:

$ rm -rf ~/.cache/hie-bios
$ cd path/to/hls
$ code .
$ cd path/to/hls2
$ ls ~/.cache/hie-bios
dist-hls-036ebb56a4cc135651b7510a90f3136d/  dist-hls2-128478ae21d411550ff54014715bf829/  ghc-pkg-e592c0c412aa044affaee5b877832a00*  wrapper-b54f81dea4c0e6d1626911c526bc4e36*

I additionally tested with making sure, both checkouts have the same name:

$ rm -rf ~/.cache/hie-bios
$ cd path/to/hls
$ code .
$ cd other/path/to/hls
$ ls ~/.cache/hie-bios
dist-hls-036ebb56a4cc135651b7510a90f3136d/  dist-hls-81c43fbeddda3d9dc27d19db33a51842/  ghc-pkg-e592c0c412aa044affaee5b877832a00*  wrapper-b54f81dea4c0e6d1626911c526bc4e36*