@@ -41,7 +41,7 @@ import GHC.Parser.Annotation
41
41
import Ide.Logger (Recorder , WithPriority ,
42
42
cmapWithPrio )
43
43
import Ide.Plugin.Eval.Types
44
-
44
+ import Debug.Trace
45
45
46
46
rules :: Recorder (WithPriority Log ) -> Rules ()
47
47
rules recorder = do
@@ -56,13 +56,13 @@ instance IsIdeGlobal EvaluatingVar
56
56
queueForEvaluation :: IdeState -> NormalizedFilePath -> IO ()
57
57
queueForEvaluation ide nfp = do
58
58
EvaluatingVar var <- getIdeGlobalState ide
59
- atomicModifyIORef' var (\ fs -> (Set. insert nfp fs, () ))
59
+ atomicModifyIORef' var (\ fs -> (trace ( " TRACE: queueForEvaluation: " <> show nfp ) $ Set. insert nfp fs, () ))
60
60
61
61
unqueueForEvaluation :: IdeState -> NormalizedFilePath -> IO ()
62
62
unqueueForEvaluation ide nfp = do
63
63
EvaluatingVar var <- getIdeGlobalState ide
64
64
-- remove the module from the Evaluating state, so that next time it won't evaluate to True
65
- atomicModifyIORef' var $ \ fs -> (Set. delete nfp fs, () )
65
+ atomicModifyIORef' var $ \ fs -> (trace ( " TRACE: unqueueForEvaluation: " <> show nfp ) $ Set. delete nfp fs, () )
66
66
67
67
apiAnnComments' :: ParsedModule -> [SrcLoc. RealLocated EpaCommentTok ]
68
68
apiAnnComments' pm = do
@@ -110,7 +110,7 @@ isEvaluatingRule :: Recorder (WithPriority Log) -> Rules ()
110
110
isEvaluatingRule recorder = defineEarlyCutoff (cmapWithPrio LogShake recorder) $ RuleNoDiagnostics $ \ IsEvaluating f -> do
111
111
alwaysRerun
112
112
EvaluatingVar var <- getIdeGlobalAction
113
- b <- liftIO $ (f `Set.member` ) <$> readIORef var
113
+ b <- fmap (ts2 " isMemberEvaluatingVar " f) . liftIO $ (f `Set.member` ) <$> readIORef var
114
114
return (Just (if b then BS. singleton 1 else BS. empty), Just b)
115
115
116
116
-- Redefine the NeedsCompilation rule to set the linkable type to Just _
@@ -120,12 +120,15 @@ isEvaluatingRule recorder = defineEarlyCutoff (cmapWithPrio LogShake recorder) $
120
120
-- leading to much better performance of the evaluate code lens
121
121
redefinedNeedsCompilation :: Recorder (WithPriority Log ) -> Rules ()
122
122
redefinedNeedsCompilation recorder = defineEarlyCutoff (cmapWithPrio LogShake recorder) $ RuleWithCustomNewnessCheck (<=) $ \ NeedsCompilation f -> do
123
- isEvaluating <- use_ IsEvaluating f
123
+ isEvaluating <- ts2 " isEvaluating " f <$> use_ IsEvaluating f
124
124
125
125
if not isEvaluating then needsCompilationRule f else do
126
126
ms <- msrModSummary . fst <$> useWithStale_ GetModSummaryWithoutTimestamps f
127
127
let df' = ms_hspp_opts ms
128
128
linkableType = computeLinkableTypeForDynFlags df'
129
129
fp = encodeLinkableType $ Just linkableType
130
130
131
- pure (Just fp, Just (Just linkableType))
131
+ pure (Just fp, ts2 " redefinedNeedsCompilation" f $ Just (Just linkableType))
132
+
133
+ ts2 :: Show a => String -> NormalizedFilePath -> a -> a
134
+ ts2 label nfp x = trace (" TRACE: " <> label <> " =" <> show x <> " (" <> show nfp <> " )" ) x
0 commit comments