Skip to content

Commit ae571bc

Browse files
committed
enable GhcSessionDeps reuse
1 parent 1b1d3f5 commit ae571bc

File tree

1 file changed

+10
-3
lines changed

1 file changed

+10
-3
lines changed

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

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -697,9 +697,16 @@ loadGhcSession ghcSessionDepsConfig = do
697697
Nothing -> LBS.toStrict $ B.encode (hash (snd val))
698698
return (Just cutoffHash, val)
699699

700-
defineNoDiagnostics $ \(GhcSessionDeps_ fullModSummary) file -> do
701-
env <- use_ GhcSession file
702-
ghcSessionDepsDefinition fullModSummary ghcSessionDepsConfig env file
700+
defineEarlyCutoff $ RuleWithCustomNewnessCheck (<=) $
701+
-- This rule uses a custom newness check that relies on the derived 'Ord' instance:
702+
-- * <previous> -> <new>
703+
-- * GhcSessionDeps True -> GhcSessionDeps False: the prev session can be reused
704+
-- * GhcSessionDeps False -> GhcSessionDeps True: the prev session cannot be reused
705+
\(GhcSessionDeps_ fullModSummary) file -> do
706+
env <- use_ GhcSession file
707+
res <- ghcSessionDepsDefinition fullModSummary ghcSessionDepsConfig env file
708+
return (Nothing, res)
709+
703710

704711
newtype GhcSessionDepsConfig = GhcSessionDepsConfig
705712
{ checkForImportCycles :: Bool

0 commit comments

Comments
 (0)