X-Git-Url: http://git.lukelau.me/?a=blobdiff_plain;f=src%2FLanguage%2FHaskell%2FLSP%2FTest.hs;h=1ce6871fb211f3a66e75f7ac95d65bbb979a4085;hb=269f303e5e44fba835c51eacfca622c488a06b9f;hp=eb09d826a82f05d5015dfabecd5c85ce4e35cb5c;hpb=57bc413473ab2900cae76ce54c3d49a8937e3562;p=lsp-test.git diff --git a/src/Language/Haskell/LSP/Test.hs b/src/Language/Haskell/LSP/Test.hs index eb09d82..1ce6871 100644 --- a/src/Language/Haskell/LSP/Test.hs +++ b/src/Language/Haskell/LSP/Test.hs @@ -121,7 +121,7 @@ runSessionWithConfig config serverExe rootDir session = do Nothing (capabilities config) (Just TraceOff) - withServer serverExe $ \serverIn serverOut _ -> + withServer serverExe (logStdErr config) $ \serverIn serverOut _ -> runSessionWithHandles serverIn serverOut listenServer config rootDir $ do -- Wrap the session around initialize and shutdown calls @@ -159,14 +159,8 @@ listenServer serverOut = do -- | The current text contents of a document. documentContents :: TextDocumentIdentifier -> Session T.Text documentContents doc = do - vfs' <- vfs <$> get - let docUri = doc ^. uri - file <- case Map.lookup docUri vfs' of - Just file -> return file - Nothing -> do - openDoc (fromJust (uriToFilePath docUri)) "" - newVfs <- vfs <$> get - return $ newVfs Map.! docUri + vfs <- vfs <$> get + let file = vfs Map.! (doc ^. uri) return $ Rope.toText $ Language.Haskell.LSP.VFS._text file -- | Parses an ApplyEditRequest, checks that it is for the passed document