Skip to content

Commit 590e71b

Browse files
committed
passing keys need to be update directly to restartShakeSession
1 parent d882e30 commit 590e71b

File tree

4 files changed

+8
-6
lines changed

4 files changed

+8
-6
lines changed

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

+1-1
Original file line numberDiff line numberDiff line change
@@ -612,7 +612,7 @@ loadSessionWithOptions recorder SessionLoadingOptions{..} dir = do
612612
invalidateShakeCache
613613

614614
-- The VFS doesn't change on cradle edits, re-use the old one.
615-
restartShakeSession VFSUnmodified "new component" []
615+
restartShakeSession VFSUnmodified "new component" [] []
616616

617617
-- Typecheck all files in the project on startup
618618
checkProject <- getCheckProject

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

+2-2
Original file line numberDiff line numberDiff line change
@@ -224,7 +224,7 @@ setFileModified recorder vfs state saved nfp = do
224224
CheckOnSave -> saved
225225
_ -> False
226226
join $ atomically $ recordDirtyKeys (shakeExtras state) GetModificationTime [nfp]
227-
restartShakeSession (shakeExtras state) vfs (fromNormalizedFilePath nfp ++ " (modified)") []
227+
restartShakeSession (shakeExtras state) vfs (fromNormalizedFilePath nfp ++ " (modified)") [] []
228228
when checkParents $
229229
typecheckParents recorder state nfp
230230

@@ -251,7 +251,7 @@ setSomethingModified vfs state keys reason = do
251251
writeTQueue (indexQueue $ hiedbWriter $ shakeExtras state) (\withHieDb -> withHieDb deleteMissingRealFiles)
252252
modifyTVar' (dirtyKeys $ shakeExtras state) $ \x ->
253253
foldl' (flip insertKeySet) x keys
254-
void $ restartShakeSession (shakeExtras state) vfs reason []
254+
void $ restartShakeSession (shakeExtras state) vfs reason [] keys
255255

256256
registerFileWatches :: [String] -> LSP.LspT Config IO Bool
257257
registerFileWatches globs = do

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

+4-2
Original file line numberDiff line numberDiff line change
@@ -300,6 +300,7 @@ data ShakeExtras = ShakeExtras
300300
:: VFSModified
301301
-> String
302302
-> [DelayedAction ()]
303+
-> [Key]
303304
-> IO ()
304305
#if MIN_VERSION_ghc(9,3,0)
305306
,ideNc :: NameCache
@@ -759,13 +760,14 @@ delayedAction a = do
759760
-- | Restart the current 'ShakeSession' with the given system actions.
760761
-- Any actions running in the current session will be aborted,
761762
-- but actions added via 'shakeEnqueue' will be requeued.
762-
shakeRestart :: Recorder (WithPriority Log) -> IdeState -> VFSModified -> String -> [DelayedAction ()] -> IO ()
763-
shakeRestart recorder IdeState{..} vfs reason acts =
763+
shakeRestart :: Recorder (WithPriority Log) -> IdeState -> VFSModified -> String -> [DelayedAction ()] -> [Key] -> IO ()
764+
shakeRestart recorder IdeState{..} vfs reason acts keys =
764765
withMVar'
765766
shakeSession
766767
(\runner -> do
767768
(stopTime,()) <- duration $ logErrorAfter 10 $ cancelShakeSession runner
768769
res <- shakeDatabaseProfile shakeDb
770+
atomically $ modifyTVar' (dirtyKeys shakeExtras) $ \x -> foldl' (flip insertKeySet) x keys
769771
backlog <- readTVarIO $ dirtyKeys shakeExtras
770772
queue <- atomicallyNamed "actionQueue - peek" $ peekInProgress $ actionQueue shakeExtras
771773

plugins/hls-cabal-plugin/src/Ide/Plugin/Cabal.hs

+1-1
Original file line numberDiff line numberDiff line change
@@ -133,7 +133,7 @@ Then we restart the shake session, so that changes to our virtual files are actu
133133
restartCabalShakeSession :: ShakeExtras -> VFS.VFS -> NormalizedFilePath -> String -> IO ()
134134
restartCabalShakeSession shakeExtras vfs file actionMsg = do
135135
join $ atomically $ Shake.recordDirtyKeys shakeExtras GetModificationTime [file]
136-
restartShakeSession shakeExtras (VFSModified vfs) (fromNormalizedFilePath file ++ " " ++ actionMsg) []
136+
restartShakeSession shakeExtras (VFSModified vfs) (fromNormalizedFilePath file ++ " " ++ actionMsg) [] []
137137

138138
-- ----------------------------------------------------------------
139139
-- Plugin Rules

0 commit comments

Comments
 (0)