@@ -22,6 +22,7 @@ module Development.IDE.Core.FileStore(
2222 registerFileWatches ,
2323 shareFilePath ,
2424 Log (.. ),
25+ setSomethingModifiedWait ,
2526 ) where
2627
2728import Control.Concurrent.STM.Stats (STM , atomically )
@@ -279,7 +280,7 @@ setFileModified recorder vfs state saved nfp actionBefore = do
279280 AlwaysCheck -> True
280281 CheckOnSave -> saved
281282 _ -> False
282- restartShakeSession (shakeExtras state) vfs (fromNormalizedFilePath nfp ++ " (modified)" ) ([mkDelayedAction " ParentTC" L. Debug (typecheckParentsAction recorder nfp) | checkParents]) $ do
283+ restartShakeSession (shakeExtras state) ShouldNotWait vfs (fromNormalizedFilePath nfp ++ " (modified)" ) ([mkDelayedAction " ParentTC" L. Debug (typecheckParentsAction recorder nfp) | checkParents]) $ do
283284 keys<- actionBefore
284285 return (toKey GetModificationTime nfp: keys)
285286
@@ -299,11 +300,16 @@ typecheckParentsAction recorder nfp = do
299300-- | Note that some keys have been modified and restart the session
300301-- Only valid if the virtual file system was initialised by LSP, as that
301302-- independently tracks which files are modified.
302- setSomethingModified :: VFSModified -> IdeState -> String -> IO [Key ] -> IO ()
303- setSomethingModified vfs state reason actionBetweenSession = do
303+ setSomethingModified' :: ShouldWait -> VFSModified -> IdeState -> String -> IO [Key ] -> IO ()
304+ setSomethingModified' shouldWait vfs state reason actionBetweenSession = do
304305 -- Update database to remove any files that might have been renamed/deleted
305306 atomically $ writeTaskQueue (indexQueue $ hiedbWriter $ shakeExtras state) (\ withHieDb -> withHieDb deleteMissingRealFiles)
306- void $ restartShakeSession (shakeExtras state) vfs reason [] actionBetweenSession
307+ void $ restartShakeSession (shakeExtras state) shouldWait vfs reason [] actionBetweenSession
308+ setSomethingModified :: VFSModified -> IdeState -> String -> IO [Key ] -> IO ()
309+ setSomethingModified vfs state reason actionBetweenSession = setSomethingModified' ShouldNotWait vfs state reason actionBetweenSession
310+
311+ setSomethingModifiedWait :: VFSModified -> IdeState -> String -> IO [Key ] -> IO ()
312+ setSomethingModifiedWait vfs state reason actionBetweenSession = setSomethingModified' ShouldWait vfs state reason actionBetweenSession
307313
308314registerFileWatches :: [String ] -> LSP. LspT Config IO Bool
309315registerFileWatches globs = do
0 commit comments