Skip to content

Commit 6cbadc7

Browse files
authored
Remove commented out code (#96)
1 parent df1ac8a commit 6cbadc7

File tree

5 files changed

+4
-43
lines changed

5 files changed

+4
-43
lines changed

hie-plugin-api/Haskell/Ide/Engine/ArtifactMap.hs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
module Haskell.Ide.Engine.ArtifactMap where
1+
module Haskell.Ide.Engine.ArtifactMap where
22

33
import Data.Maybe
44
import qualified Data.IntervalMap.FingerTree as IM

hie-plugin-api/Haskell/Ide/Engine/Ghc.hs

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -160,7 +160,7 @@ captureDiagnostics rfm action = do
160160

161161
foldDFlags :: (a -> DynFlags -> DynFlags) -> [a] -> DynFlags -> DynFlags
162162
foldDFlags f xs x = foldr f x xs
163-
163+
164164
setDeferTypeErrors =
165165
foldDFlags (flip wopt_set) [Opt_WarnTypedHoles, Opt_WarnDeferredTypeErrors, Opt_WarnDeferredOutOfScopeVariables]
166166
. foldDFlags setGeneralFlag' [Opt_DeferTypedHoles, Opt_DeferTypeErrors, Opt_DeferOutOfScopeVariables]
@@ -269,13 +269,11 @@ setTypecheckedModule_load uri =
269269

270270
Session sess <- GhcT pure
271271
modifyMTS (\s -> s {ghcSession = Just sess})
272-
-- cacheModules rfm ts
273272
cacheModules rfm [_tm]
274273
debugm "setTypecheckedModule: done"
275274

276275
Nothing -> do
277276
debugm $ "setTypecheckedModule: Didn't get typechecked or parsed module for: " ++ show fp
278-
--debugm $ "setTypecheckedModule: errs: " ++ show errs
279277
failModule fp
280278

281279
-- Turn any fatal exceptions thrown by GHC into a diagnostic for

hie-plugin-api/Haskell/Ide/Engine/GhcUtils.hs

Lines changed: 0 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -21,25 +21,6 @@ toMessager k _hsc_env (nk, n) _rc_reason ms =
2121
mod_name = T.pack $ moduleNameString (moduleName (ms_mod ms))
2222
in k prog
2323

24-
{-
25-
toMessager :: Messager
26-
toMessager hsc_env mod_index recomp mod_summary =
27-
case recomp of
28-
MustCompile -> showMsg "Compiling " ""
29-
UpToDate
30-
| verbosity (hsc_dflags hsc_env) >= 2 -> showMsg "Skipping " ""
31-
| otherwise -> return ()
32-
RecompBecause reason -> showMsg "Compiling " (" [" ++ reason ++ "]")
33-
where
34-
dflags = hsc_dflags hsc_env
35-
showMsg msg reason =
36-
compilationProgressMsg dflags $
37-
(showModuleIndex mod_index ++
38-
msg ++ showModMsg dflags (hscTarget dflags)
39-
(recompileRequired recomp) mod_summary)
40-
++ reason
41-
-}
42-
4324
-- Handlers for each type of error that ghc can throw
4425
errorHandlers :: (String -> m a) -> (HscTypes.SourceError -> m a) -> [ErrorHandler m a]
4526
errorHandlers onGhcError onSourceError = handlers

hie-plugin-api/Haskell/Ide/Engine/PluginsIdeMonads.hs

Lines changed: 1 addition & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,6 @@ module Haskell.Ide.Engine.PluginsIdeMonads
6363
, getPlugins
6464
, withProgress
6565
, withIndefiniteProgress
66-
, persistVirtualFile
6766
, persistVirtualFile'
6867
, getPersistedFile
6968
, reverseFileMap
@@ -405,12 +404,6 @@ getVirtualFile uri = do
405404
Just lf -> liftIO $ Core.getVirtualFileFunc lf (toNormalizedUri uri)
406405
Nothing -> return Nothing
407406

408-
-- | Persist a virtual file as a temporary file in the filesystem.
409-
-- If the virtual file associated to the given URI does not exist then
410-
-- the FilePath parsed from the URI is returned.
411-
persistVirtualFile :: (MonadIde m, MonadIO m) => Uri -> m FilePath
412-
persistVirtualFile uri = fromMaybe (error "persist") <$> getPersistedFile uri
413-
414407
-- | Worker function for persistVirtualFile without monad constraints.
415408
--
416409
-- Persist a virtual file as a temporary file in the filesystem.
@@ -490,7 +483,7 @@ withIndefiniteProgress t c f = do
490483
data IdeState = IdeState
491484
{ moduleCache :: !GhcModuleCache
492485
-- | A queue of requests to be performed once a module is loaded
493-
, requestQueue :: Map.Map FilePath [UriCacheResult -> IdeM ()]
486+
, requestQueue :: !(Map.Map FilePath [UriCacheResult -> IdeM ()])
494487
, extensibleState :: !(Map.Map TypeRep Dynamic)
495488
, ghcSession :: !(Maybe (IORef HscEnv))
496489
}
@@ -536,17 +529,6 @@ instance HasGhcModuleCache IdeM where
536529
tvar <- lift ask
537530
atomically $ modifyTVar' tvar (\st -> st { moduleCache = f (moduleCache st) })
538531

539-
-- ---------------------------------------------------------------------
540-
541-
{-
542-
instance GHC.HasDynFlags IdeGhcM where
543-
getDynFlags = GHC.hsc_dflags <$> GHC.getSession
544-
545-
instance GHC.GhcMonad IdeGhcM where
546-
getSession = GM.unGmlT GM.gmlGetSession
547-
setSession env = GM.unGmlT (GM.gmlSetSession env)
548-
-}
549-
550532
-- ---------------------------------------------------------------------
551533
-- Results
552534
-- ---------------------------------------------------------------------

src/Haskell/Ide/Engine/Scheduler.hs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -106,7 +106,7 @@ newScheduler
106106
:: IdePlugins
107107
-- ^ The list of plugins that will be used for responding to requests
108108
-> CradleOpts
109-
-- ^ Options for the ghc-mod session. Since we only keep a single ghc-mod session
109+
-- ^ Options for the bios session. Since we only keep a single bios option record.
110110
-> IO (Scheduler m)
111111
newScheduler plugins cradleOpts = do
112112
cancelTVar <- STM.atomically $ STM.newTVar Set.empty

0 commit comments

Comments
 (0)