fpco-api 1.2.0.3 → 1.2.0.4
raw patch · 2 files changed
+3/−8 lines, 2 filesdep −texts
Dependencies removed: texts
Files
- fpco-api.cabal +1/−2
- src/library/FP/Server.hs +2/−6
fpco-api.cabal view
@@ -1,5 +1,5 @@ name: fpco-api-version: 1.2.0.3+version: 1.2.0.4 synopsis: Simple interface to the FP Complete IDE API. description: A server and library for communicating with the FP Complete IDE API. homepage: https://www.fpcomplete.com/page/api@@ -78,7 +78,6 @@ , syb >= 0.4 , template-haskell >= 2.7 , text >= 0.11- , texts >= 0.3 , time >= 1.4 , transformers >= 0.3 , transformers-base >= 0.4
src/library/FP/Server.hs view
@@ -51,7 +51,6 @@ import System.Directory import System.FilePath import System.IO-import Texts.English -- | Run the given Server command with the config. Good for testing in the repl. runWithConfig :: ServerM () b -> Config -> IO b@@ -350,7 +349,7 @@ -- | Reply with the given value. reply :: (ToJSON a,Show a) => Handle -> a -> Server () reply h r = do- $(logDebug) ("-> " <> ellipsize 140 (T.pack (show r)))+ $(logDebug) ("-> " <> T.take 140 (T.pack (show r))) io (L8.hPutStrLn h (encode r)) -- | Close the given handle.@@ -448,7 +447,7 @@ , requestBody = RequestBodyLBS $ encode (encodeFpco cmd) , checkStatus = \_ _ _ -> Nothing }- $(logDebug) ("=> " <> trunc (T.pack (show cmd)))+ $(logDebug) ("=> " <> T.take 140 (T.pack (show cmd))) resp <- io (runResourceT (httpLbs req ccManager)) io $ writeIORef ccCookie (responseCookieJar resp) let code = statusCode (responseStatus resp)@@ -459,9 +458,6 @@ then mempty else "\nResponse: " <> decodeUtf8With lenientDecode (S8.concat (LBS.toChunks (responseBody resp))) else return (responseBody resp)--trunc :: T.Text -> T.Text-trunc = ellipsize 140 errPrefix :: Show cmd => T.Text -> cmd -> T.Text errPrefix msg cmd = "Error from request, while " <> msg <> ": " <> T.pack (show cmd) <> "\n"