import System.IO
import System.Process (ProcessHandle())
import System.Timeout
-import System.IO.Temp
-- | A session representing one instance of launching and connecting to a server.
--
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 =
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)) =