Skip to content

Commit 222b050

Browse files
committed
Add comment to updateHscEnvEq call
1 parent f570d5f commit 222b050

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

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

+5
Original file line numberDiff line numberDiff line change
@@ -799,6 +799,11 @@ ghcSessionDepsDefinition fullModSummary GhcSessionDepsConfig{..} env file = do
799799
#endif
800800
session' <- liftIO $ mergeEnvs hsc moduleNode inLoadOrder depSessions
801801

802+
-- Here we avoid a call to to `newHscEnvEqWithImportPaths`, which creates a new
803+
-- ExportsMap when it is called. We only need to create the ExportsMap once per
804+
-- session, while `ghcSessionDepsDefinition` will be called for each file we need
805+
-- to compile. `updateHscEnvEq` will refresh the HscEnv (session') and also
806+
-- generate a new Unique.
802807
Just <$> liftIO (updateHscEnvEq env session')
803808

804809
-- | Load a iface from disk, or generate it if there isn't one or it is out of date

0 commit comments

Comments
 (0)