Skip to content

Exit with non-zero exitcode if wrapper fails to launch #4110

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 3 commits into from
Mar 3, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions .github/scripts/test.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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"
}

Expand Down
6 changes: 4 additions & 2 deletions exe/Wrapper.hs
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down