Skip to content

Remove commented out code #96

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 5 commits into from
Dec 20, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion hie-plugin-api/Haskell/Ide/Engine/ArtifactMap.hs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
module Haskell.Ide.Engine.ArtifactMap where
module Haskell.Ide.Engine.ArtifactMap where

import Data.Maybe
import qualified Data.IntervalMap.FingerTree as IM
Expand Down
4 changes: 1 addition & 3 deletions hie-plugin-api/Haskell/Ide/Engine/Ghc.hs
Original file line number Diff line number Diff line change
Expand Up @@ -160,7 +160,7 @@ captureDiagnostics rfm action = do

foldDFlags :: (a -> DynFlags -> DynFlags) -> [a] -> DynFlags -> DynFlags
foldDFlags f xs x = foldr f x xs

setDeferTypeErrors =
foldDFlags (flip wopt_set) [Opt_WarnTypedHoles, Opt_WarnDeferredTypeErrors, Opt_WarnDeferredOutOfScopeVariables]
. foldDFlags setGeneralFlag' [Opt_DeferTypedHoles, Opt_DeferTypeErrors, Opt_DeferOutOfScopeVariables]
Expand Down Expand Up @@ -269,13 +269,11 @@ setTypecheckedModule_load uri =

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

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

-- Turn any fatal exceptions thrown by GHC into a diagnostic for
Expand Down
19 changes: 0 additions & 19 deletions hie-plugin-api/Haskell/Ide/Engine/GhcUtils.hs
Original file line number Diff line number Diff line change
Expand Up @@ -21,25 +21,6 @@ toMessager k _hsc_env (nk, n) _rc_reason ms =
mod_name = T.pack $ moduleNameString (moduleName (ms_mod ms))
in k prog

{-
toMessager :: Messager
toMessager hsc_env mod_index recomp mod_summary =
case recomp of
MustCompile -> showMsg "Compiling " ""
UpToDate
| verbosity (hsc_dflags hsc_env) >= 2 -> showMsg "Skipping " ""
| otherwise -> return ()
RecompBecause reason -> showMsg "Compiling " (" [" ++ reason ++ "]")
where
dflags = hsc_dflags hsc_env
showMsg msg reason =
compilationProgressMsg dflags $
(showModuleIndex mod_index ++
msg ++ showModMsg dflags (hscTarget dflags)
(recompileRequired recomp) mod_summary)
++ reason
-}

-- Handlers for each type of error that ghc can throw
errorHandlers :: (String -> m a) -> (HscTypes.SourceError -> m a) -> [ErrorHandler m a]
errorHandlers onGhcError onSourceError = handlers
Expand Down
20 changes: 1 addition & 19 deletions hie-plugin-api/Haskell/Ide/Engine/PluginsIdeMonads.hs
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,6 @@ module Haskell.Ide.Engine.PluginsIdeMonads
, getPlugins
, withProgress
, withIndefiniteProgress
, persistVirtualFile
, persistVirtualFile'
, getPersistedFile
, reverseFileMap
Expand Down Expand Up @@ -405,12 +404,6 @@ getVirtualFile uri = do
Just lf -> liftIO $ Core.getVirtualFileFunc lf (toNormalizedUri uri)
Nothing -> return Nothing

-- | Persist a virtual file as a temporary file in the filesystem.
-- If the virtual file associated to the given URI does not exist then
-- the FilePath parsed from the URI is returned.
persistVirtualFile :: (MonadIde m, MonadIO m) => Uri -> m FilePath
persistVirtualFile uri = fromMaybe (error "persist") <$> getPersistedFile uri

-- | Worker function for persistVirtualFile without monad constraints.
--
-- Persist a virtual file as a temporary file in the filesystem.
Expand Down Expand Up @@ -490,7 +483,7 @@ withIndefiniteProgress t c f = do
data IdeState = IdeState
{ moduleCache :: !GhcModuleCache
-- | A queue of requests to be performed once a module is loaded
, requestQueue :: Map.Map FilePath [UriCacheResult -> IdeM ()]
, requestQueue :: !(Map.Map FilePath [UriCacheResult -> IdeM ()])
, extensibleState :: !(Map.Map TypeRep Dynamic)
, ghcSession :: !(Maybe (IORef HscEnv))
}
Expand Down Expand Up @@ -536,17 +529,6 @@ instance HasGhcModuleCache IdeM where
tvar <- lift ask
atomically $ modifyTVar' tvar (\st -> st { moduleCache = f (moduleCache st) })

-- ---------------------------------------------------------------------

{-
instance GHC.HasDynFlags IdeGhcM where
getDynFlags = GHC.hsc_dflags <$> GHC.getSession

instance GHC.GhcMonad IdeGhcM where
getSession = GM.unGmlT GM.gmlGetSession
setSession env = GM.unGmlT (GM.gmlSetSession env)
-}

-- ---------------------------------------------------------------------
-- Results
-- ---------------------------------------------------------------------
Expand Down
2 changes: 1 addition & 1 deletion src/Haskell/Ide/Engine/Scheduler.hs
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,7 @@ newScheduler
:: IdePlugins
-- ^ The list of plugins that will be used for responding to requests
-> CradleOpts
-- ^ Options for the ghc-mod session. Since we only keep a single ghc-mod session
-- ^ Options for the bios session. Since we only keep a single bios option record.
-> IO (Scheduler m)
newScheduler plugins cradleOpts = do
cancelTVar <- STM.atomically $ STM.newTVar Set.empty
Expand Down