Skip to content

Commit 826b3f7

Browse files
committed
cleanup
1 parent df21318 commit 826b3f7

File tree

1 file changed

+4
-18
lines changed

1 file changed

+4
-18
lines changed

ghcide/session-loader/Development/IDE/Session.hs

Lines changed: 4 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -103,7 +103,6 @@ import Data.HashSet (HashSet)
103103
import qualified Data.HashSet as Set
104104
import qualified Data.Set as OS
105105
import Database.SQLite.Simple
106-
import Development.IDE.Core.Tracing (withTrace)
107106
import Development.IDE.Core.WorkerThread (awaitRunInThread,
108107
withWorkerQueue)
109108
import qualified Development.IDE.GHC.Compat.Util as Compat
@@ -120,19 +119,13 @@ import qualified System.Random as Random
120119
import System.Random (RandomGen)
121120
import Text.ParserCombinators.ReadP (readP_to_S)
122121

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)
129122
import GHC.Data.Bag
130123
import GHC.Driver.Env (hsc_all_home_unit_ids)
131124
import GHC.Driver.Errors.Types
132125
import GHC.Types.Error (errMsgDiagnostic,
133126
singleMessage)
134127
import GHC.Unit.State
135-
import qualified HIE.Bios.Cradle as HieBios
128+
136129

137130
data Log
138131
= LogSettingInitialDynFlags
@@ -733,26 +726,19 @@ loadSessionWithOptions recorder SessionLoadingOptions{..} rootDir que = do
733726
-- to get some more options then we wait for the currently running action to finish
734727
-- before attempting to do so.
735728
let getOptionsBatch :: FilePath -> IO (IdeResult HscEnvEq, [FilePath])
736-
getOptionsBatch file' = do
729+
getOptionsBatch file = do
737730
pendingFiles <- atomically $ flushTQueue pendingFilesTQueue
738-
let file = toAbsolutePath file'
739731
hieYaml <- cradleLoc file
740732
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)
742734
return (results Map.! file) `Safe.catch` \e ->
743735
return (([renderPackageSetupException file e], Nothing), maybe [] pure hieYaml)
744736

745737
returnWithVersion $ \file -> do
746738
-- see Note [Serializing runs in separate thread]
747-
atomically $ writeTQueue pendingFilesTQueue file
739+
atomically $ writeTQueue pendingFilesTQueue $ toAbsolutePath file
748740
awaitRunInThread que $ getOptionsBatch file
749741

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 ()
756742

757743
-- how we do batch loading of cradles depends on the the type of cradle we are using
758744
cradleToOptsAndLibDirs :: Recorder (WithPriority Log) -> SessionLoadingPreferenceConfig -> [(Cradle Void, (Maybe FilePath, FilePath))] -> [FilePath]

0 commit comments

Comments
 (0)