Remove waitForProcess in finalizer for windows
[lsp-test.git] / src / Language / Haskell / LSP / Test / Session.hs
index 4b1793f28312986437bae1c8e4e8ff32c1cead5d..9e4aa81aa1fc960ccd1cbc48509f44541b9ceb8e 100644 (file)
@@ -71,7 +71,10 @@ import Language.Haskell.LSP.Test.Exceptions
 import System.Console.ANSI
 import System.Directory
 import System.IO
-import System.Process (waitForProcess, ProcessHandle())
+import System.Process (ProcessHandle())
+#ifndef mingw32_HOST_OS
+import System.Process (waitForProcess)
+#endif
 import System.Timeout
 
 -- | A session representing one instance of launching and connecting to a server.
@@ -271,7 +274,10 @@ runSessionWithHandles serverIn serverOut serverProc serverHandler config caps ro
           -- handles etc via cleanupProcess
           killThread tid
           -- 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 serverProc)
+#endif
           cleanupProcess server
 
   (result, _) <- bracket serverListenerLauncher
@@ -369,7 +375,7 @@ updateState (ReqApplyWorkspaceEdit r) = do
           m <- vfsMap . vfs <$> get
           let curVer = fromMaybe 0 $
                 _lsp_version <$> m Map.!? (toNormalizedUri uri)
-          pure $ map (VersionedTextDocumentIdentifier uri . Just) [curVer..]
+          pure $ map (VersionedTextDocumentIdentifier uri . Just) [curVer + 1..]
 
         textDocumentEdits uri edits = do
           vers <- textDocumentVersions uri