@@ -14,6 +14,7 @@ module Development.IDE.Core.FileStore(
1414 makeLSPVFSHandle
1515 ) where
1616
17+import System.IO
1718import Development.IDE.GHC.Orphans()
1819import Development.IDE.Core.Shake
1920import Control.Concurrent.Extra
@@ -95,13 +96,15 @@ getModificationTimeRule :: VFSHandle -> Rules ()
9596getModificationTimeRule vfs =
9697 defineEarlyCutoff $ \GetModificationTime file -> do
9798 let file' = fromNormalizedFilePath file
98− let wrap time@(l,s) = (Just $ BS.pack $ show time, ([], Just $ ModificationTime l s))
99+ let wrap time@(l,s) = do
100+ hPutStrLn stderr (show $ BS.pack $ show time)
101+ pure (Just $ BS.pack $ show time, ([], Just $ ModificationTime l s))
99102 alwaysRerun
100103 mbVirtual <- liftIO $ getVirtualFile vfs $ filePathToUri' file
101104 case mbVirtual of
102105 Just (virtualFileVersion -> ver) ->
103106 pure (Just $ BS.pack $ show ver, ([], Just $ VFSVersion ver))
104− Nothing -> liftIO $ fmap wrap (getModTime file')
107+ Nothing -> liftIO $ (wrap =<< getModTime file')
105108 `catch` \(e :: IOException) -> do
106109 let err | isDoesNotExistError e = "File does not exist: " ++ file'
107110 | otherwise = "IO error while reading " ++ file' ++ ", " ++ displayException e
@@ -130,6 +133,7 @@ getModificationTimeRule vfs =
130133 Posix.throwErrnoPathIfMinus1Retry_ "getmodtime" f $ c_getModTime f' secPtr nsecPtr
131134 sec <- peek secPtr
132135 nsec <- peek nsecPtr
136+ hPutStrLn stderr (show (f, sec, nsec))
133137 pure (fromEnum sec, fromIntegral nsec)
134138
135139-- Sadly even unix’s getFileStatus + modificationTimeHiRes is still about twice as slow