Skip to content

Commit ef370d5

Browse files
committed
Fix Eval plugin
1 parent 9d6ba9e commit ef370d5

File tree

2 files changed

+12
-3
lines changed

2 files changed

+12
-3
lines changed

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

+5-1
Original file line numberDiff line numberDiff line change
@@ -686,11 +686,13 @@ loadGhcSession ghcSessionDepsConfig = do
686686
data GhcSessionDepsConfig = GhcSessionDepsConfig
687687
{ checkForImportCycles :: Bool
688688
, forceLinkables :: Bool
689+
, fullModSummary :: Bool
689690
}
690691
instance Default GhcSessionDepsConfig where
691692
def = GhcSessionDepsConfig
692693
{ checkForImportCycles = True
693694
, forceLinkables = False
695+
, fullModSummary = False
694696
}
695697

696698
ghcSessionDepsDefinition :: GhcSessionDepsConfig -> HscEnvEq -> NormalizedFilePath -> Action (Maybe HscEnvEq)
@@ -702,7 +704,9 @@ ghcSessionDepsDefinition GhcSessionDepsConfig{..} env file = do
702704
Nothing -> return Nothing
703705
Just deps -> do
704706
when checkForImportCycles $ void $ uses_ ReportImportCycles deps
705-
ms:mss <- map msrModSummary <$> uses_ GetModSummaryWithoutTimestamps (file:deps)
707+
ms:mss <- map msrModSummary <$> if fullModSummary
708+
then uses_ GetModSummary (file:deps)
709+
else uses_ GetModSummaryWithoutTimestamps (file:deps)
706710

707711
depSessions <- map hscEnv <$> uses_ GhcSessionDeps deps
708712
let uses_th_qq =

plugins/hls-eval-plugin/src/Ide/Plugin/Eval/CodeLens.hs

+7-2
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,7 @@ import Development.IDE (GetModSummary (..),
5050
ModSummaryResult (..),
5151
NeedsCompilation (NeedsCompilation),
5252
evalGhcEnv, hscEnv,
53+
hscEnvWithImportPaths,
5354
prettyPrint, runAction,
5455
textToStringBuffer,
5556
toNormalizedFilePath',
@@ -538,8 +539,12 @@ runGetSession st nfp = liftIO $ runAction "eval" st $ do
538539
let fp = fromNormalizedFilePath nfp
539540
((_, res),_) <- liftIO $ loadSessionFun fp
540541
let env = fromMaybe (error $ "Unknown file: " <> fp) res
541-
ghcSessionDepsConfig = def{forceLinkables = True, checkForImportCycles = False}
542-
res <- fmap hscEnv <$> ghcSessionDepsDefinition ghcSessionDepsConfig env nfp
542+
ghcSessionDepsConfig = def
543+
{ forceLinkables = True
544+
, checkForImportCycles = False
545+
, fullModSummary = True
546+
}
547+
res <- fmap hscEnvWithImportPaths <$> ghcSessionDepsDefinition ghcSessionDepsConfig env nfp
543548
return $ fromMaybe (error $ "Unable to load file: " <> fp) res
544549

545550
needsQuickCheck :: [(Section, Test)] -> Bool

0 commit comments

Comments
 (0)