@@ -103,7 +103,6 @@ import Data.HashSet (HashSet)
103
103
import qualified Data.HashSet as Set
104
104
import qualified Data.Set as OS
105
105
import Database.SQLite.Simple
106
- import Development.IDE.Core.Tracing (withTrace )
107
106
import Development.IDE.Core.WorkerThread (awaitRunInThread ,
108
107
withWorkerQueue )
109
108
import qualified Development.IDE.GHC.Compat.Util as Compat
@@ -120,19 +119,13 @@ import qualified System.Random as Random
120
119
import System.Random (RandomGen )
121
120
import Text.ParserCombinators.ReadP (readP_to_S )
122
121
123
- import Control.Exception.Extra (errorIO )
124
- import qualified Data.HashMap.Strict as HashMap
125
- import qualified Data.Tuple as Tuple
126
- import Development.IDE.Core.OfInterest (OfInterestVar (OfInterestVar ),
127
- getFilesOfInterest ,
128
- getFilesOfInterestUntracked )
129
122
import GHC.Data.Bag
130
123
import GHC.Driver.Env (hsc_all_home_unit_ids )
131
124
import GHC.Driver.Errors.Types
132
125
import GHC.Types.Error (errMsgDiagnostic ,
133
126
singleMessage )
134
127
import GHC.Unit.State
135
- import qualified HIE.Bios.Cradle as HieBios
128
+
136
129
137
130
data Log
138
131
= LogSettingInitialDynFlags
@@ -733,26 +726,19 @@ loadSessionWithOptions recorder SessionLoadingOptions{..} rootDir que = do
733
726
-- to get some more options then we wait for the currently running action to finish
734
727
-- before attempting to do so.
735
728
let getOptionsBatch :: FilePath -> IO (IdeResult HscEnvEq , [FilePath ])
736
- getOptionsBatch file' = do
729
+ getOptionsBatch file = do
737
730
pendingFiles <- atomically $ flushTQueue pendingFilesTQueue
738
- let file = toAbsolutePath file'
739
731
hieYaml <- cradleLoc file
740
732
logWith recorder Debug LogSettingInitialDynFlags
741
- results <- getOptionsList (Set. toList $ Set. fromList $ toAbsolutePath file : map fromNormalizedFilePath pendingFiles)
733
+ results <- getOptionsList (Set. toList $ Set. fromList $ file : pendingFiles)
742
734
return (results Map. ! file) `Safe.catch` \ e ->
743
735
return (([renderPackageSetupException file e], Nothing ), maybe [] pure hieYaml)
744
736
745
737
returnWithVersion $ \ file -> do
746
738
-- see Note [Serializing runs in separate thread]
747
- atomically $ writeTQueue pendingFilesTQueue file
739
+ atomically $ writeTQueue pendingFilesTQueue $ toAbsolutePath file
748
740
awaitRunInThread que $ getOptionsBatch file
749
741
750
- -- cradleToType :: Cradle Void -> IO ()
751
- -- cradleToType c = do
752
- -- case c of
753
- -- Cradle { cradleOptsProg = Just (GHC.GhcVersion _), cradleOptsProg = Just (GHC.GhcVersion _) } -> return ()
754
- -- _ ->
755
- -- return ()
756
742
757
743
-- how we do batch loading of cradles depends on the the type of cradle we are using
758
744
cradleToOptsAndLibDirs :: Recorder (WithPriority Log ) -> SessionLoadingPreferenceConfig -> [(Cradle Void , (Maybe FilePath , FilePath ))] -> [FilePath ]
0 commit comments