X-Git-Url: https://git.lukelau.me/?a=blobdiff_plain;f=src%2FLanguage%2FLSP%2FTest%2FSession.hs;h=aabf04f2b73e18620de2af30cec84055a31a1219;hb=56c39e493dfc0bf610e3807f69ccc7af8549d3e3;hp=5839a15619a18963296a35d632a1f4233a95944c;hpb=cf9e06e2eb79b113ff861866690f14166d1fa4e7;p=lsp-test.git diff --git a/src/Language/LSP/Test/Session.hs b/src/Language/LSP/Test/Session.hs index 5839a15..aabf04f 100644 --- a/src/Language/LSP/Test/Session.hs +++ b/src/Language/LSP/Test/Session.hs @@ -6,6 +6,7 @@ {-# LANGUAGE MultiParamTypeClasses #-} {-# LANGUAGE FlexibleContexts #-} {-# LANGUAGE RankNTypes #-} +{-# LANGUAGE TypeInType #-} module Language.LSP.Test.Session ( Session(..) @@ -134,7 +135,7 @@ data SessionContext = SessionContext -- 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 } @@ -274,7 +275,10 @@ runSession' serverIn serverOut mServerProc serverHandler config caps rootDir exi 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))