HLS is prepared for cabal’s multi-repl
feature. There are some small caveats, though:
-
HLS 2.8.0.0 (not available in ghcup yet, iirc) supports the
multi-repl
feature but doesn’t use it by default. You have to enable it by explicitly setting the LSP option"sessionLoading": "multiComponent"
. How you specify this option depends on your LSP client. The respective vscode-haskell release that adds support for this option is yet to happen, as we are bogged down by GitHub CI issues. -
HLS 2.7.0.0 also supports the
mutli-repl
feature already, and will use it by default ifcabal-install 3.12
is installed on your system and you load more than one component. In other words, you use the experimentalmulti-repl
feature if you load a library and executable into the HLS session andcabal-install 3.12
is on the $PATH.