File tree Expand file tree Collapse file tree 2 files changed +7
-3
lines changed
ghcide/src/Development/IDE/Core
plugins/hls-refine-imports-plugin/src/Ide/Plugin Expand file tree Collapse file tree 2 files changed +7
-3
lines changed Original file line number Diff line number Diff line change @@ -650,7 +650,11 @@ typeCheckRule :: Recorder (WithPriority Log) -> Rules ()
650650typeCheckRule recorder = define (cmapWithPrio LogShake recorder) $ \ TypeCheck file -> do
651651 pm <- use_ GetParsedModule file
652652 hsc <- hscEnv <$> use_ GhcSessionDeps file
653- typeCheckRuleDefinition hsc pm
653+ foi <- use_ IsFileOfInterest file
654+ -- We should only call the typecheck rule for files of interest.
655+ -- Keeping typechecked modules in memory for other files is
656+ -- very expensive.
657+ assert (foi /= NotFOI ) $ typeCheckRuleDefinition hsc pm
654658
655659knownFilesRule :: Recorder (WithPriority Log ) -> Rules ()
656660knownFilesRule recorder = defineEarlyCutOffNoFile (cmapWithPrio LogShake recorder) $ \ GetKnownTargets -> do
Original file line number Diff line number Diff line change @@ -187,8 +187,8 @@ refineImportsRule recorder = define (cmapWithPrio LogShake recorder) $ \RefineIm
187187 -- second layer is from the imports of first layer to their imports
188188 ImportMap importIm <- use_ GetImportMap path
189189 forM importIm $ \ imp_path -> do
190- imp_tmr <- use_ TypeCheck imp_path
191- return $ tcg_exports $ tmrTypechecked imp_tmr
190+ imp_hir <- use_ GetModIface imp_path
191+ return $ mi_exports $ hirModIface imp_hir
192192
193193 -- Use the GHC api to extract the "minimal" imports
194194 -- We shouldn't blindly refine imports
You can’t perform that action at this time.
0 commit comments