Allow to pass cabal args to 'compile hls'

This breaks the existing cli interface, but whatever.
This commit is contained in:
2021-11-12 01:13:57 +01:00
parent 8eea9bd6a5
commit 274978a8a7
3 changed files with 25 additions and 16 deletions

View File

@@ -753,6 +753,7 @@ compileHLS :: ( MonadMask m
-> Maybe FilePath
-> Maybe FilePath
-> Maybe FilePath
-> [Text] -- ^ additional args to cabal install
-> Excepts '[ NoDownload
, GPGError
, DownloadFailed
@@ -763,11 +764,12 @@ compileHLS :: ( MonadMask m
, BuildFailed
, NotInstalled
] m Version
compileHLS targetHLS ghcs jobs ov isolateDir cabalProject cabalProjectLocal patchdir = do
compileHLS targetHLS ghcs jobs ov isolateDir cabalProject cabalProjectLocal patchdir cabalArgs = do
PlatformRequest { .. } <- lift getPlatformReq
GHCupInfo { _ghcupDownloads = dls } <- lift getGHCupInfo
Dirs { .. } <- lift getDirs
(workdir, tver) <- case targetHLS of
-- unpack from version tarball
Left tver -> do
@@ -867,7 +869,8 @@ compileHLS targetHLS ghcs jobs ov isolateDir cabalProject cabalProjectLocal patc
, "--disable-tests"
, "--installdir=" <> ghcInstallDir
, "--project-file=" <> cp
, "exe:haskell-language-server"
] ++ fmap T.unpack cabalArgs ++ [
"exe:haskell-language-server"
, "exe:haskell-language-server-wrapper"]
)
(Just workdir) "cabal" Nothing