{-# LANGUAGE MultiParamTypeClasses #-}
{-# LANGUAGE FlexibleContexts #-}
{-# LANGUAGE RankNTypes #-}
+{-# LANGUAGE TypeInType #-}
module Language.LSP.Test.Session
( Session(..)
-- Keep curTimeoutId in SessionContext, as its tied to messageChan
, curTimeoutId :: MVar Int -- ^ The current timeout we are waiting on
, requestMap :: MVar RequestMap
- , initRsp :: MVar InitializeResponse
+ , initRsp :: MVar (ResponseMessage Initialize)
, config :: SessionConfig
, sessionCapabilities :: ClientCapabilities
}
let cleanup
| Just sp <- mServerProc = do
-- Give the server some time to exit cleanly
+ -- It makes the server hangs in windows so we have to avoid it
+#ifndef mingw32_HOST_OS
timeout msgTimeoutMs (waitForProcess sp)
+#endif
cleanupProcess (Just serverIn, Just serverOut, Nothing, sp)
| otherwise = pure ()
finally (timeout msgTimeoutMs (runSession' exitServer))