Skip to content

Commit cce8f01

Browse files
committed
WIP: remove debug statments
1 parent faa2d8b commit cce8f01

File tree

1 file changed

+3
-10
lines changed

1 file changed

+3
-10
lines changed

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

Lines changed: 3 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -124,9 +124,6 @@ import GHC.Driver.Errors.Types
124124
import GHC.Types.Error (errMsgDiagnostic,
125125
singleMessage)
126126
import GHC.Unit.State
127-
import Debug.Trace (traceShow)
128-
import Text.Pretty.Simple (pPrint)
129-
import Debug.Pretty.Simple (pTraceShow, pTraceShowId)
130127

131128
#if MIN_VERSION_ghc(9,13,0)
132129
import GHC.Driver.Make (checkHomeUnitsClosed)
@@ -577,13 +574,13 @@ loadSessionWithOptions recorder SessionLoadingOptions{..} rootDir que = do
577574
])
578575
Nothing
579576

580-
void $ modifyVar' fileToFlags $ pTraceShow ("this_flags_map", this_flags_map) $ Map.insert hieYaml this_flags_map
577+
void $ modifyVar' fileToFlags $ Map.insert hieYaml this_flags_map
581578
void $ modifyVar' filesMap $ flip HM.union (HM.fromList (map ((,hieYaml) . fst) $ concatMap toFlagsMap all_targets))
582579
-- The VFS doesn't change on cradle edits, re-use the old one.
583580
-- Invalidate all the existing GhcSession build nodes by restarting the Shake session
584581
keys2 <- invalidateShakeCache
585582
restartShakeSession VFSUnmodified "new component" [] $ do
586-
keys1 <- extendKnownTargets $ pTraceShow ("all_targets", all_targets) all_targets
583+
keys1 <- extendKnownTargets all_targets
587584
return [keys1, keys2]
588585

589586
-- Typecheck all files in the project on startup
@@ -641,7 +638,7 @@ loadSessionWithOptions recorder SessionLoadingOptions{..} rootDir que = do
641638
let ncfp = toNormalizedFilePath' cfp
642639
let res = (map (\err' -> renderCradleError err' cradle ncfp) err, Nothing)
643640
void $ modifyVar' fileToFlags $
644-
Map.insertWith HM.union hieYaml (pTraceShow ("ncfp", ncfp) $ HM.singleton ncfp (res, dep_info))
641+
Map.insertWith HM.union hieYaml $ HM.singleton ncfp (res, dep_info)
645642
void $ modifyVar' filesMap $ HM.insert ncfp hieYaml
646643
return (res, maybe [] pure hieYaml ++ concatMap cradleErrorDependencies err)
647644

@@ -679,11 +676,9 @@ loadSessionWithOptions recorder SessionLoadingOptions{..} rootDir que = do
679676

680677
v <- Map.findWithDefault HM.empty hieYaml <$> readVar fileToFlags
681678
let cfp = toAbsolutePath file
682-
pPrint ("sessionOpts", cfp)
683679
case HM.lookup (toNormalizedFilePath' cfp) v of
684680
Just (opts, old_di) -> do
685681
deps_ok <- checkDependencyInfo old_di
686-
pPrint ("deps_ok", deps_ok, old_di)
687682
if not deps_ok
688683
then do
689684
-- If the dependencies are out of date then clear both caches and start
@@ -692,11 +687,9 @@ loadSessionWithOptions recorder SessionLoadingOptions{..} rootDir que = do
692687
modifyVar_ filesMap (const (return HM.empty))
693688
-- Keep the same name cache
694689
modifyVar_ hscEnvs (return . Map.adjust (const []) hieYaml )
695-
pPrint ("consultCradle not deps_ok", cfp)
696690
consultCradle hieYaml cfp
697691
else return (opts, Map.keys old_di)
698692
Nothing -> do
699-
pPrint ("consultCradle Nothing", cfp)
700693
consultCradle hieYaml cfp
701694

702695
-- The main function which gets options for a file. We only want one of these running

0 commit comments

Comments
 (0)