@@ -22,6 +22,7 @@ module Development.IDE.Core.FileStore(
22
22
registerFileWatches ,
23
23
shareFilePath ,
24
24
Log (.. ),
25
+ setSomethingModifiedWait ,
25
26
) where
26
27
27
28
import Control.Concurrent.STM.Stats (STM , atomically )
@@ -279,7 +280,7 @@ setFileModified recorder vfs state saved nfp actionBefore = do
279
280
AlwaysCheck -> True
280
281
CheckOnSave -> saved
281
282
_ -> 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
283
284
keys<- actionBefore
284
285
return (toKey GetModificationTime nfp: keys)
285
286
@@ -299,11 +300,16 @@ typecheckParentsAction recorder nfp = do
299
300
-- | Note that some keys have been modified and restart the session
300
301
-- Only valid if the virtual file system was initialised by LSP, as that
301
302
-- 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
304
305
-- Update database to remove any files that might have been renamed/deleted
305
306
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
307
313
308
314
registerFileWatches :: [String ] -> LSP. LspT Config IO Bool
309
315
registerFileWatches globs = do
0 commit comments