Skip to content

Commit 63b1956

Browse files
committed
remove record dirty key recordDirtyKeys
1 parent 610355c commit 63b1956

File tree

2 files changed

+4
-13
lines changed

2 files changed

+4
-13
lines changed

ghcide/session-loader/Development/IDE/Session.hs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -613,10 +613,10 @@ loadSessionWithOptions recorder SessionLoadingOptions{..} dir = do
613613

614614
void $ modifyVar' fileToFlags $ Map.insert hieYaml this_flags_map
615615
void $ modifyVar' filesMap $ flip HM.union (HM.fromList (map ((,hieYaml) . fst) $ concatMap toFlagsMap all_targets))
616+
key1 <- extendKnownTargets all_targets
617+
key2 <- invalidateShakeCache
616618
-- The VFS doesn't change on cradle edits, re-use the old one.
617619
restartShakeSession VFSUnmodified "new component" [] $ do
618-
key1 <- extendKnownTargets all_targets
619-
key2 <- invalidateShakeCache
620620
return [key1, key2]
621621
-- Invalidate all the existing GhcSession build nodes by restarting the Shake session
622622

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

Lines changed: 2 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@ module Development.IDE.Core.Shake(
5757
FileVersion(..),
5858
updatePositionMapping,
5959
updatePositionMappingHelper,
60-
deleteValue, recordDirtyKeys,
60+
deleteValue,
6161
WithProgressFunc, WithIndefiniteProgressFunc,
6262
ProgressEvent(..),
6363
DelayedAction, mkDelayedAction,
@@ -569,15 +569,6 @@ deleteValue ShakeExtras{dirtyKeys, state} key file = do
569569
return [toKey key file]
570570

571571

572-
recordDirtyKeys
573-
:: ShakeExtras
574-
-> [Key]
575-
-> STM (IO ())
576-
recordDirtyKeys ShakeExtras{dirtyKeys} keys = do
577-
modifyTVar' dirtyKeys $ \x -> foldl' (flip insertKeySet) x keys
578-
return $ withEventTrace "recordDirtyKeys" $ \addEvent -> do
579-
addEvent (fromString $ unlines $ "dirty " : map show keys)
580-
581572
-- | We return Nothing if the rule has not run and Just Failed if it has failed to produce a value.
582573
getValues ::
583574
forall k v.
@@ -766,7 +757,7 @@ shakeRestart recorder IdeState{..} vfs reason acts ioActionBetweenShakeSession =
766757
(\runner -> do
767758
(stopTime,()) <- duration $ logErrorAfter 10 $ cancelShakeSession runner
768759
keys <- ioActionBetweenShakeSession
769-
join $ atomically $ recordDirtyKeys shakeExtras keys
760+
atomically $ modifyTVar' (dirtyKeys shakeExtras) $ \x -> foldl' (flip insertKeySet) x keys
770761
res <- shakeDatabaseProfile shakeDb
771762
backlog <- readTVarIO $ dirtyKeys shakeExtras
772763
queue <- atomicallyNamed "actionQueue - peek" $ peekInProgress $ actionQueue shakeExtras

0 commit comments

Comments
 (0)