Replies: 1 comment
-
HLS can cope with multiple or components within one cabal project, but does not work across multiple projects. You need to configure your editor to consider both of those to be "workspace folders", which will probably result in an independent HLS process for each. |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
I manage my Haskell development via GHCup, so I use
ghcup tui
to install and updatecabal
/GHC/HLS (no Stack installed), andcabal
to install libraries if I need them (e.g.cabal install --lib flow
, if I needed toimport Flow
).Assume I have two sibling directories as these,
where
foo.hs
containsbar.hs
containsfoo.cabal
containsbar.cabal
and both
cabal.project
files containIn Vim (I use YouCompleteMe plugin) I can verify that HLS is running in the project directory of the first of those two files to be open; indeed, if I opened Vim via
vim -O dir1/bar.hs dir2/foo.hs
(which opensbar.hs
on the left and focuses it first, andfoo.hs
on the right) all is fine withbar.hs
, but as soon as I moving to the other file, an error like the following is shownwhich seems to support my understanding that HLS has detected one project and got "stuck" on it.
If I delete the two
cabal.project
files, so the structure isthe issue does not occur, so I think the problem occurs when jumping across two projects.
Is this the case? Or, if the IDE that uses HLS is supposed to handle the scenario above, what information can I provide for you to help me understand what I'm doing wrong?
I've already spoken to YouCompleteMe devs, and they say that Vim+YCM seems to be sending the correct info to HLS, so I'm coming here to seek some help understanding what I'm doing wrong.
Here is a screencast: untitled - asciinema.org
Beta Was this translation helpful? Give feedback.
All reactions