diff --git a/.github/scripts/test.sh b/.github/scripts/test.sh index 396f185008..04cf680779 100644 --- a/.github/scripts/test.sh +++ b/.github/scripts/test.sh @@ -48,6 +48,8 @@ test_all_hls() { fi fi done + # install the recommended GHC version so the wrapper can launch HLS + ghcup install ghc --set recommended "$bindir/haskell-language-server-wrapper${ext}" typecheck "${test_module}" || fail "failed to typecheck with HLS wrapper" } diff --git a/exe/Wrapper.hs b/exe/Wrapper.hs index 128b369e2c..020f842dd4 100644 --- a/exe/Wrapper.hs +++ b/exe/Wrapper.hs @@ -99,8 +99,10 @@ main = do Left err -> do T.hPutStrLn stderr (prettyError err NoShorten) case args of - Ghcide _ -> launchErrorLSP recorder (prettyError err Shorten) - _ -> pure () + Ghcide (GhcideArguments { argsCommand = Main.LSP }) -> + launchErrorLSP recorder (prettyError err Shorten) + + _ -> exitFailure launchHaskellLanguageServer :: Recorder (WithPriority (Doc ())) -> Arguments -> IO (Either WrapperSetupError ()) launchHaskellLanguageServer recorder parsedArgs = do