File tree 2 files changed +7
-3
lines changed
ghcide/src/Development/IDE/Core
plugins/hls-refine-imports-plugin/src/Ide/Plugin 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 ()
650
650
typeCheckRule recorder = define (cmapWithPrio LogShake recorder) $ \ TypeCheck file -> do
651
651
pm <- use_ GetParsedModule file
652
652
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
654
658
655
659
knownFilesRule :: Recorder (WithPriority Log ) -> Rules ()
656
660
knownFilesRule 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
187
187
-- second layer is from the imports of first layer to their imports
188
188
ImportMap importIm <- use_ GetImportMap path
189
189
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
192
192
193
193
-- Use the GHC api to extract the "minimal" imports
194
194
-- We shouldn't blindly refine imports
You can’t perform that action at this time.
0 commit comments