Skip to content

Commit ff770e0

Browse files
authored
Fix tracing of recordDirtyKeys (#2505)
1 parent 15d7402 commit ff770e0

File tree

2 files changed

+5
-5
lines changed

2 files changed

+5
-5
lines changed

ghcide/src/Development/IDE/Core/Shake.hs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -455,7 +455,7 @@ recordDirtyKeys
455455
recordDirtyKeys ShakeExtras{dirtyKeys} key file = do
456456
modifyTVar' dirtyKeys $ \x -> foldl' (flip HSet.insert) x (toKey key <$> file)
457457
return $ withEventTrace "recordDirtyKeys" $ \addEvent -> do
458-
addEvent (fromString $ "dirty " <> show key) (fromString $ unlines $ map fromNormalizedFilePath file)
458+
addEvent (fromString $ unlines $ "dirty " <> show key : map fromNormalizedFilePath file)
459459

460460
-- | We return Nothing if the rule has not run and Just Failed if it has failed to produce a value.
461461
getValues ::

ghcide/src/Development/IDE/Core/Tracing.hs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -71,11 +71,11 @@ import qualified StmContainers.Map as STM
7171
#if MIN_VERSION_ghc(8,8,0)
7272
otTracedProvider :: MonadUnliftIO m => PluginId -> ByteString -> m a -> m a
7373
otTracedGarbageCollection :: (MonadMask f, MonadIO f, Show a) => ByteString -> f [a] -> f [a]
74-
withEventTrace :: (MonadMask m, MonadIO m) => String -> ((ByteString -> ByteString -> m ()) -> m a) -> m a
74+
withEventTrace :: (MonadMask m, MonadIO m) => String -> ((ByteString -> m ()) -> m a) -> m a
7575
#else
7676
otTracedProvider :: MonadUnliftIO m => PluginId -> String -> m a -> m a
7777
otTracedGarbageCollection :: (MonadMask f, MonadIO f, Show a) => String -> f [a] -> f [a]
78-
withEventTrace :: (MonadMask m, MonadIO m) => String -> ((String -> ByteString -> m ()) -> m a) -> m a
78+
withEventTrace :: (MonadMask m, MonadIO m) => String -> ((ByteString -> m ()) -> m a) -> m a
7979
#endif
8080

8181
withTrace :: (MonadMask m, MonadIO m) =>
@@ -90,8 +90,8 @@ withTrace name act
9090
withEventTrace name act
9191
| userTracingEnabled
9292
= withSpan (fromString name) $ \sp -> do
93-
act (addEvent sp)
94-
| otherwise = act (\_ _ -> pure ())
93+
act (addEvent sp "")
94+
| otherwise = act (\_ -> pure ())
9595

9696
-- | Returns a logger that produces telemetry events in a single span
9797
withTelemetryLogger :: (MonadIO m, MonadMask m) => (Logger -> m a) -> m a

0 commit comments

Comments
 (0)