Closed
Description
Loading multiple cabal/stack components into HLS has been a pain point since its early beginnings.
Essentially, it allows us to provide diagnostics and code actions across components, such as libraries, executables, test suites, etc...
In this issue, we outline the current progress of native multiple home unit support.
- Cabal
--enable-multi-repl
support, added in 3.11 Add support for loading multiple components into one repl session cabal#8726 - GHC multiple home units, added 9.4 https://gitlab.haskell.org/ghc/ghc/-/issues/10827
- HLS needs to support multiple home units:
- Hie-bios API changes to permit using cabal 3.11's multi repl support Multi Component cabal support hie-bios#409
- Release HLS with the new hie-bios version
This means, we have native multi repl support for cabal >=3.11 and GHC >=9.4 once hie-bios's #409 is merged and published.
However, not everyone can switch to cabal-3.12
(once it is released), so we are thinking about adding custom support for older cabal versions, using build-info
and exploiting the information from plan.json
. The idea is as follows:
- For all targets, figure out the component they belong to using
build-info.json
- Calculate the dependency closure of all targets that shall be loaded into the same GHC session. This upholds the closure property for GHC.
- Read the respective
build-info.json
files to find the build options of local components.