mirror of
https://github.com/haskell/haskell-language-server.git
synced 2024-09-20 21:29:01 +03:00
wrapper: cd to --cwd earlier
Currently, if `haskell-language-server-wrapper` is called with `--cwd`, a cradle will first be loaded and _then_ the change of working directory will happen. This commit reorders this such that if `--cwd` is supplied, the very first action is to change directory. This means a cradle will be found with `--cwd`, rather than the directory that `haskell-language-server-wrapper` was called in.
This commit is contained in:
parent
6d9b12ee7d
commit
248e8dfac8
@ -47,6 +47,8 @@ main = do
|
||||
|
||||
launchHaskellLanguageServer :: LspArguments -> IO ()
|
||||
launchHaskellLanguageServer LspArguments{..} = do
|
||||
whenJust argsCwd setCurrentDirectory
|
||||
|
||||
d <- getCurrentDirectory
|
||||
|
||||
-- Get the cabal directory from the cradle
|
||||
@ -55,8 +57,6 @@ launchHaskellLanguageServer LspArguments{..} = do
|
||||
|
||||
when argsProjectGhcVersion $ getRuntimeGhcVersion' cradle >>= putStrLn >> exitSuccess
|
||||
|
||||
whenJust argsCwd setCurrentDirectory
|
||||
|
||||
progName <- getProgName
|
||||
hPutStrLn stderr $ "Run entered for haskell-language-server-wrapper(" ++ progName ++ ") "
|
||||
++ hlsVersion
|
||||
|
Loading…
Reference in New Issue
Block a user