Skip to content

Commit 6216417

Browse files
committed
Trace closer to root cause
1 parent 8852d4d commit 6216417

File tree

3 files changed

+10
-4
lines changed

3 files changed

+10
-4
lines changed

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

+5-2
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,7 @@ import Language.LSP.VFS
7171
import System.FilePath
7272
import System.IO.Error
7373
import System.IO.Unsafe
74-
74+
import Debug.Trace
7575

7676
data Log
7777
= LogCouldNotIdentifyReverseDeps !NormalizedFilePath
@@ -250,7 +250,10 @@ setSomethingModified vfs state keys reason = do
250250
atomically $ do
251251
writeTQueue (indexQueue $ hiedbWriter $ shakeExtras state) (\withHieDb -> withHieDb deleteMissingRealFiles)
252252
modifyTVar' (dirtyKeys $ shakeExtras state) $ \x ->
253-
foldl' (flip insertKeySet) x keys
253+
foldl' (\xs k ->
254+
--trace ("TRACE: insertDirkyKey: " <> show k) $
255+
256+
insertKeySet k xs) x keys
254257
void $ restartShakeSession (shakeExtras state) vfs reason []
255258

256259
registerFileWatches :: [String] -> LSP.LspT Config IO Bool

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

+1-1
Original file line numberDiff line numberDiff line change
@@ -181,7 +181,7 @@ import GHC (mgModSummaries)
181181
import qualified Data.IntMap as IM
182182
#endif
183183

184-
import Debug.Trace
184+
import Debug.Trace
185185

186186
data Log
187187
= LogShake Shake.Log

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

+4-1
Original file line numberDiff line numberDiff line change
@@ -172,6 +172,7 @@ import qualified StmContainers.Map as STM
172172
import System.FilePath hiding (makeRelative)
173173
import System.IO.Unsafe (unsafePerformIO)
174174
import System.Time.Extra
175+
import Debug.Trace
175176
-- See Note [Guidelines For Using CPP In GHCIDE Import Statements]
176177

177178
#if !MIN_VERSION_ghc(9,3,0)
@@ -1234,7 +1235,9 @@ defineEarlyCutoff' doDiagnostics cmp key file mbOld mode action = do
12341235
(if eq then ChangedRecomputeSame else ChangedRecomputeDiff)
12351236
(encodeShakeValue bs) $
12361237
A res
1237-
liftIO $ atomicallyNamed "define - dirtyKeys" $ modifyTVar' dirtyKeys (deleteKeySet $ toKey key file)
1238+
liftIO $ atomicallyNamed "define - dirtyKeys" $ modifyTVar' dirtyKeys (
1239+
trace ("TRACE: delete dirty key " <> show key <> " file " <> show file) $
1240+
deleteKeySet $ toKey key file)
12381241
return res
12391242
where
12401243
-- Highly unsafe helper to compute the version of a file

0 commit comments

Comments
 (0)