From 998a43ce24151fc197a9c7abba8d6a1195be3756 Mon Sep 17 00:00:00 2001 From: Kazu Yamamoto Date: Fri, 11 Apr 2014 12:56:06 +0900 Subject: [PATCH] removing depanal. --- Language/Haskell/GhcMod/Gap.hs | 8 +++++--- Language/Haskell/GhcMod/Info.hs | 2 +- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/Language/Haskell/GhcMod/Gap.hs b/Language/Haskell/GhcMod/Gap.hs index c565d09..c1d62a5 100644 --- a/Language/Haskell/GhcMod/Gap.hs +++ b/Language/Haskell/GhcMod/Gap.hs @@ -184,9 +184,10 @@ fOptions = [option | (option,_,_) <- fFlags] ---------------------------------------------------------------- ---------------------------------------------------------------- -setCtx :: FilePath -> [ModSummary] -> Ghc ModSummary +setCtx :: FilePath -> Ghc ModSummary #if __GLASGOW_HASKELL__ >= 704 -setCtx file mss = do +setCtx file = do + mss <- getModuleGraph #if __GLASGOW_HASKELL__ >= 706 let modName = IIModule . moduleName . ms_mod #else @@ -197,7 +198,8 @@ setCtx file mss = do let [ms] = filter (\m -> ml_hs_file (ms_location m) == Just file) mss return ms #else -setCtx file mss = do +setCtx file = do + mss <- getModuleGraph top <- map ms_mod <$> filterM isTop mss setContext top [] let [ms] = filter (\m -> ml_hs_file (ms_location m) == Just file) mss diff --git a/Language/Haskell/GhcMod/Info.hs b/Language/Haskell/GhcMod/Info.hs index 7bb4afa..1db6aad 100644 --- a/Language/Haskell/GhcMod/Info.hs +++ b/Language/Haskell/GhcMod/Info.hs @@ -140,6 +140,6 @@ inModuleContext opt cradle file action errmsg = ghandle handler $ do void $ initializeFlagsWithCradle opt cradle noWaringOptions False setTargetFiles [file] void $ G.load LoadAllTargets - G.depanal [] False >>= Gap.setCtx file >>= action + Gap.setCtx file >>= action where handler (SomeException _) = return errmsg