@@ -100,6 +100,7 @@ import qualified Data.Text.Encoding as T
100
100
import Data.Time (UTCTime (.. ))
101
101
import Data.Tuple.Extra
102
102
import Data.Typeable (cast )
103
+ import qualified Data.Unique as Unique
103
104
import Development.IDE.Core.Compile
104
105
import Development.IDE.Core.FileExists hiding (LogShake , Log )
105
106
import Development.IDE.Core.FileStore (getFileContents ,
@@ -771,35 +772,13 @@ ghcSessionDepsDefinition
771
772
Bool ->
772
773
GhcSessionDepsConfig -> HscEnvEq -> NormalizedFilePath -> Action (Maybe HscEnvEq )
773
774
ghcSessionDepsDefinition fullModSummary GhcSessionDepsConfig {.. } env file = do
774
- let hsc = hscEnv env
775
-
776
775
mbdeps <- mapM (fmap artifactFilePath . snd ) <$> use_ GetLocatedImports file
777
776
case mbdeps of
778
777
Nothing -> return Nothing
779
778
Just deps -> do
780
779
when checkForImportCycles $ void $ uses_ ReportImportCycles deps
781
- ms <- msrModSummary <$> if fullModSummary
782
- then use_ GetModSummary file
783
- else use_ GetModSummaryWithoutTimestamps file
784
-
785
- depSessions <- map hscEnv <$> uses_ (GhcSessionDeps_ fullModSummary) deps
786
- ifaces <- uses_ GetModIface deps
787
- let inLoadOrder = map (\ HiFileResult {.. } -> HomeModInfo hirModIface hirModDetails emptyHomeModInfoLinkable) ifaces
788
- #if MIN_VERSION_ghc(9,3,0)
789
- -- On GHC 9.4+, the module graph contains not only ModSummary's but each `ModuleNode` in the graph
790
- -- also points to all the direct descendants of the current module. To get the keys for the descendants
791
- -- we must get their `ModSummary`s
792
- ! final_deps <- do
793
- dep_mss <- map msrModSummary <$> uses_ GetModSummaryWithoutTimestamps deps
794
- -- Don't want to retain references to the entire ModSummary when just the key will do
795
- return $!! map (NodeKey_Module . msKey) dep_mss
796
- let moduleNode = (ms, final_deps)
797
- #else
798
- let moduleNode = ms
799
- #endif
800
- session' <- liftIO $ mergeEnvs hsc moduleNode inLoadOrder depSessions
801
-
802
- Just <$> liftIO (newHscEnvEqWithImportPaths (envImportPaths env) session' [] )
780
+ let updateUnique newUnique = env { envUnique = newUnique }
781
+ Just . updateUnique <$> liftIO Unique. newUnique
803
782
804
783
-- | Load a iface from disk, or generate it if there isn't one or it is out of date
805
784
-- This rule also ensures that the `.hie` and `.o` (if needed) files are written out.
0 commit comments