@@ -531,7 +531,7 @@ loadSessionWithOptions recorder SessionLoadingOptions{..} rootDir = do
531
531
-- -> Action (IdeResult HscEnvEq,[FilePath])
532
532
let session args@ (hieYaml, _cfp, _opts, _libDir) = do
533
533
ShakeExtras {ideNc} <- getShakeExtras
534
- IdeOptions { optCheckProject = getCheckProject , optExtensions } <- getIdeOptions
534
+ IdeOptions { optExtensions } <- getIdeOptions
535
535
(new_deps, old_deps) <- packageSetup args
536
536
537
537
-- For each component, now make a new HscEnvEq which contains the
@@ -797,22 +797,20 @@ loadSessionWithOptions recorder SessionLoadingOptions{..} rootDir = do
797
797
-- before attempting to do so.
798
798
ShakeExtras {restartShakeSession } <- getShakeExtras
799
799
IdeOptions { optCheckProject = getCheckProject} <- getIdeOptions
800
- returnWithVersion $ \ file ->
800
+ returnWithVersion $ \ file -> do
801
801
-- only one cradle consult at a time
802
- UnliftIO. withMVar cradleLock $ const $ do
803
- -- we need to find a way to get rid of the (files, keys)
804
- _opts@ (a, b, _files, _keys) <- use_ HieYaml file
805
- -- _opts@(a, b, _files, _keys) <- getOptions file
806
- async <- UnliftIO. async $ do
802
+ async <- UnliftIO. async $ UnliftIO. withMVar cradleLock $ const $ do
803
+ -- we need to find a way to get rid of the (files, keys)
804
+ _opts@ (a, b, _files, _keys) <- use_ HieYaml file
807
805
files <- liftIO $ atomically $ swapTVar targetFiles []
808
806
keys <- liftIO $ atomically $ swapTVar restartKeys []
809
807
_ <- useNoFile_ SessionCacheVersion
810
808
liftIO $ when (notNull files || notNull keys) $ do
811
809
checkProject <- getCheckProject
812
810
-- think of not to restart a second time
813
811
restartShakeSession VFSUnmodified " new component" (if checkProject then return (typecheckAll files) else mempty ) $ pure keys
814
- UnliftIO. wait async
815
- pure $ ( fmap . fmap ) toAbsolutePath (a, b) )
812
+ pure $ ( fmap . fmap ) toAbsolutePath (a, b)
813
+ UnliftIO. wait async )
816
814
817
815
818
816
-- | Run the specific cradle on a specific FilePath via hie-bios.
@@ -1135,17 +1133,6 @@ type FlagsMap = Map.Map (Maybe FilePath) (HM.HashMap NormalizedFilePath (IdeResu
1135
1133
-- It aims to be the reverse of 'FlagsMap'.
1136
1134
type FilesMap = HM. HashMap NormalizedFilePath (Maybe FilePath )
1137
1135
1138
- -- file1 -> hie1.yaml -> (opts, deps)
1139
- -- file2 -> hie1.yaml -> (opts, deps)
1140
- -- file3 -> hie1.yaml -> (opts, deps)
1141
- -- if some new file4 should be in hie1.yaml,
1142
- -- we need to recompute the hie1.yaml
1143
-
1144
- -- hieRule file
1145
- -- get corresponding hie.yaml
1146
-
1147
-
1148
-
1149
1136
-- This is pristine information about a component
1150
1137
data RawComponentInfo = RawComponentInfo
1151
1138
{ rawComponentUnitId :: UnitId
0 commit comments