From: Alan Zimmerman Date: Sun, 10 Nov 2019 20:06:54 +0000 (+0000) Subject: Use initVFS to simplify runSession mechanics X-Git-Tag: 0.8.1.0~1^2~1 X-Git-Url: https://git.lukelau.me/?p=lsp-test.git;a=commitdiff_plain;h=6f69337aa146eedf0bca00d7a1d7bb507ef95c56 Use initVFS to simplify runSession mechanics --- diff --git a/src/Language/Haskell/LSP/Test/Session.hs b/src/Language/Haskell/LSP/Test/Session.hs index e4f6a64..07b33e8 100644 --- a/src/Language/Haskell/LSP/Test/Session.hs +++ b/src/Language/Haskell/LSP/Test/Session.hs @@ -221,10 +221,9 @@ runSessionWithHandles serverIn serverOut serverProc serverHandler config caps ro mainThreadId <- myThreadId let context = SessionContext serverIn absRootDir messageChan reqMap initRsp config caps - initState tmp_dir = SessionState (IdInt 0) (VFS mempty tmp_dir) + initState vfs = SessionState (IdInt 0) vfs mempty 0 False Nothing - runSession' ses = withSystemTempDirectory "lsp-test" $ \tmp_dir -> - runSession context (initState tmp_dir) ses + runSession' ses = initVFS $ \vfs -> runSession context (initState vfs) ses errorHandler = throwTo mainThreadId :: SessionException -> IO() serverListenerLauncher =