|
4 | 4 | module Echidna.MCP where |
5 | 5 |
|
6 | 6 | import Control.Concurrent (forkIO) |
7 | | -import Control.Monad (forever, when) |
| 7 | +import Control.Monad (forever, unless) |
8 | 8 | import Control.Concurrent.STM |
9 | | -import Data.IORef (readIORef, writeIORef, modifyIORef', newIORef, IORef) |
| 9 | +import Data.IORef (readIORef, modifyIORef', newIORef, IORef) |
10 | 10 | import Data.List (find, isPrefixOf) |
11 | 11 | import qualified Data.Maybe |
12 | 12 | import qualified Data.Set as Set |
@@ -72,7 +72,7 @@ statusTool workerRefs statusRef _ env _ _ = do |
72 | 72 |
|
73 | 73 | let timeStr = case st.lastCoverageTime of |
74 | 74 | Nothing -> "Never" |
75 | | - Just t -> show (round $ diffUTCTime now t) |
| 75 | + Just t -> show (round (diffUTCTime now t) :: Integer) |
76 | 76 |
|
77 | 77 | funcs = if null st.coveredFunctions |
78 | 78 | then "None" |
@@ -240,7 +240,7 @@ readLogsTool _ _ _ logsRef = do |
240 | 240 | -- logs is [Newest, ..., Oldest] |
241 | 241 | -- We want to take the 100 newest, and show them in chronological order |
242 | 242 | let logsToShow = reverse $ take 100 logs |
243 | | - return $ unpack $ T.unlines $ logsToShow |
| 243 | + return $ unpack $ T.unlines logsToShow |
244 | 244 |
|
245 | 245 | -- | Implementation of show_coverage tool |
246 | 246 | showCoverageTool :: ToolExecution |
@@ -310,7 +310,7 @@ runMCPServer env workerRefs port logsRef = do |
310 | 310 | msg <- atomically $ readTChan myBus |
311 | 311 | case msg of |
312 | 312 | WrappedMessage _ (Broadcast (NewCoverageInfo _ txs isReplaying)) -> do |
313 | | - when (not isReplaying) $ do |
| 313 | + unless isReplaying $ do |
314 | 314 | now <- getCurrentTime |
315 | 315 | let funcNames = map getFunctionName txs |
316 | 316 | lastFunc = if null funcNames then "unknown" else last funcNames |
|
0 commit comments