X-Git-Url: https://git.lukelau.me/?a=blobdiff_plain;f=src%2FLanguage%2FHaskell%2FLSP%2FTest%2FSession.hs;h=07b33e888c5c3eb44f931ce138e87c2569acdcea;hb=6f69337aa146eedf0bca00d7a1d7bb507ef95c56;hp=a4532b8f1bc2351243e51b9eee3c5d6cf8f94720;hpb=e947642c734b4dd081e59b2afcaf3228d1b2f5a9;p=lsp-test.git diff --git a/src/Language/Haskell/LSP/Test/Session.hs b/src/Language/Haskell/LSP/Test/Session.hs index a4532b8..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 = @@ -300,7 +299,7 @@ updateState (ReqApplyWorkspaceEdit r) = do liftIO $ B.hPut (serverIn ctx) $ addHeader (encode msg) modifyM $ \s -> do - newVFS <- liftIO $ openVFS (vfs s) msg + let (newVFS,_) = openVFS (vfs s) msg return $ s { vfs = newVFS } getParams (TextDocumentEdit docId (List edits)) =