@@ -10,7 +10,6 @@ import qualified Data.IntervalMap.FingerTree as IM
10
10
11
11
import qualified GHC
12
12
import GHC ( TypecheckedModule )
13
- import GhcMod.SrcUtils
14
13
15
14
import Data.Data as Data
16
15
import Control.Monad.IO.Class
@@ -31,9 +30,11 @@ genTypeMap tm = do
31
30
hs_env <- GHC. getSession
32
31
liftIO $ types hs_env typecheckedSource
33
32
34
- collectAllSpansTypes'
35
- :: GHC. GhcMonad m => Bool -> TypecheckedModule -> m [(GHC. SrcSpan , GHC. Type )]
36
- collectAllSpansTypes' = collectAllSpansTypes
33
+
34
+ everythingInTypecheckedSourceM
35
+ :: Data x => (forall a . Data a => a -> IO TypeMap ) -> x -> IO TypeMap
36
+ everythingInTypecheckedSourceM = everythingButTypeM @ GHC. Id
37
+
37
38
38
39
-- | Obtain details map for types.
39
40
types :: GHC. HscEnv -> GHC. TypecheckedSource -> IO TypeMap
@@ -53,11 +54,6 @@ types hs_env = everythingInTypecheckedSourceM (ty `combineM` fun)
53
54
return (IM. singleton (rspToInt spn) (TcHsSyn. hsPatType hsPatType))
54
55
_ -> return IM. empty
55
56
56
-
57
- everythingInTypecheckedSourceM
58
- :: Data x => (forall a . Data a => a -> IO TypeMap ) -> x -> IO TypeMap
59
- everythingInTypecheckedSourceM f = everythingButTypeM @ GHC. Id f
60
-
61
57
-- | Combine two queries into one using alternative combinator.
62
58
combineM
63
59
:: (forall a . Data a => a -> IO TypeMap )
@@ -115,7 +111,7 @@ everythingButM f x = do
115
111
-- Since the above is quite costly, we just skip cases where computing the
116
112
-- expression's type is going to be expensive.
117
113
--
118
- -- See #16233
114
+ -- See #16233<https://gitlab.haskell.org/ghc/ghc/issues/16233>
119
115
getType
120
116
:: GHC. HscEnv -> GHC. LHsExpr GHC. GhcTc -> IO (Maybe (GHC. SrcSpan , Type. Type ))
121
117
getType hs_env e@ (GHC. L spn e') =
0 commit comments