@@ -27,7 +27,7 @@ module Ide.Plugin.Eval.CodeLens (
27
27
28
28
import Control.Applicative (Alternative ((<|>) ))
29
29
import Control.Arrow (second , (>>>) )
30
- import Control.Exception (assert , try )
30
+ import Control.Exception (try )
31
31
import qualified Control.Exception as E
32
32
import Control.Lens (_1 , _3 , (%~) , (<&>) , (^.) )
33
33
import Control.Monad (guard , join , void , when )
@@ -38,31 +38,23 @@ import Data.Char (isSpace)
38
38
import qualified Data.HashMap.Strict as HashMap
39
39
import Data.List (dropWhileEnd , find ,
40
40
intercalate , intersperse )
41
- import Data.Maybe (catMaybes , fromMaybe , isJust )
41
+ import Data.Maybe (catMaybes , fromMaybe )
42
42
import Data.String (IsString )
43
43
import Data.Text (Text )
44
44
import qualified Data.Text as T
45
45
import Data.Time (getCurrentTime )
46
46
import Data.Typeable (Typeable )
47
- import Development.IDE (Action , GetDependencies (.. ),
48
- GetModIface (.. ),
49
- GetModSummary (.. ),
50
- GhcSessionIO (.. ),
51
- HiFileResult (hirHomeMod , hirModSummary ),
52
- HscEnvEq , IdeState ,
47
+ import Development.IDE (GetModSummary (.. ),
48
+ GhcSessionIO (.. ), IdeState ,
53
49
ModSummaryResult (.. ),
54
50
NeedsCompilation (NeedsCompilation ),
55
51
evalGhcEnv , hscEnv ,
56
- hscEnvWithImportPaths ,
57
52
prettyPrint , runAction ,
58
53
textToStringBuffer ,
59
54
toNormalizedFilePath' ,
60
55
uriToFilePath' , useNoFile_ ,
61
- useWithStale_ , use_ , uses_ )
62
- import Development.IDE.Core.Compile (loadModulesHome ,
63
- setupFinderCache )
64
- import Development.IDE.Core.Rules (TransitiveDependencies (transitiveModuleDeps ),
65
- ghcSessionDepsDefinition )
56
+ useWithStale_ , use_ )
57
+ import Development.IDE.Core.Rules (ghcSessionDepsDefinition )
66
58
import Development.IDE.GHC.Compat hiding (typeKind , unitState )
67
59
import qualified Development.IDE.GHC.Compat as Compat
68
60
import qualified Development.IDE.GHC.Compat as SrcLoc
@@ -544,7 +536,8 @@ runGetSession st nfp = liftIO $ runAction "eval" st $ do
544
536
let fp = fromNormalizedFilePath nfp
545
537
((_, res),_) <- liftIO $ loadSessionFun fp
546
538
let env = fromMaybe (error $ " Unknown file: " <> fp) res
547
- hscEnv <$> ghcSessionDepsDefinition False env nfp
539
+ res <- fmap hscEnv <$> ghcSessionDepsDefinition False env nfp
540
+ return $ fromMaybe (error $ " Unable to load file: " <> fp) res
548
541
549
542
needsQuickCheck :: [(Section , Test )] -> Bool
550
543
needsQuickCheck = any (isProperty . snd )
0 commit comments