File tree 6 files changed +63
-0
lines changed
6 files changed +63
-0
lines changed Original file line number Diff line number Diff line change @@ -46,4 +46,7 @@ library
46
46
hs-source-dirs : src-ghc810 src-reexport
47
47
if (impl(ghc >= 9.0 ) && impl(ghc < 9.1 ) || flag(ghc-lib))
48
48
hs-source-dirs : src-ghc901
49
+ if (impl(ghc >= 9.2 ) && impl(ghc < 9.3 ))
50
+ hs-source-dirs : src-ghc902
51
+
49
52
Original file line number Diff line number Diff line change
1
+ {-
2
+ Forked from GHC v9.2.1 to work around the readFile side effect in mkHiefile
3
+
4
+ Main functions for .hie file generation
5
+ -}
6
+ {- HLINT ignore -}
7
+ {-# OPTIONS_GHC -Wno-incomplete-uni-patterns #-}
8
+
9
+ module Compat.HieAst ( mkHieFile , enrichHie ) where
10
+
11
+ import GHC.Data.Maybe (expectJust )
12
+ import GHC.Driver.Env
13
+ import GHC.Hs
14
+ import GHC.Tc.Types (TcGblEnv )
15
+ import GHC.Types.Avail (Avails )
16
+ import GHC.Unit.Module (ml_hs_file )
17
+ import GHC.Unit.Module.ModSummary (ModSummary (.. ))
18
+
19
+ import GHC.Iface.Ext.Ast (enrichHie , mkHieFileWithSource )
20
+ import GHC.Iface.Ext.Types
21
+
22
+ import qualified Data.ByteString as BS
23
+
24
+
25
+ type RenamedSource = ( HsGroup GhcRn , [LImportDecl GhcRn ]
26
+ , Maybe [(LIE GhcRn , Avails )]
27
+ , Maybe LHsDocString )
28
+
29
+ -- | Construct an 'HieFile' from the outputs of the typechecker.
30
+ mkHieFile :: ModSummary
31
+ -> TcGblEnv
32
+ -> RenamedSource
33
+ -> BS. ByteString -> Hsc HieFile
34
+ mkHieFile ms ts rs src = do
35
+ let src_file = expectJust " mkHieFile" (ml_hs_file $ ms_location ms)
36
+ mkHieFileWithSource src_file src ms ts rs
Original file line number Diff line number Diff line change
1
+ {-
2
+ Binary serialization for .hie files.
3
+ -}
4
+
5
+ module Compat.HieBin ( module GHC.Iface.Ext.Binary )
6
+ where
7
+
8
+ import GHC.Iface.Ext.Binary
Original file line number Diff line number Diff line change
1
+ module Compat.HieDebug
2
+ ( module GHC.Iface.Ext.Debug
3
+ , ppHie ) where
4
+ import GHC.Iface.Ext.Debug
5
+
6
+ import GHC.Iface.Ext.Types (HieAST )
7
+ import GHC.Utils.Outputable (Outputable (ppr ), SDoc )
8
+
9
+ ppHie :: Outputable a => HieAST a -> SDoc
10
+ ppHie = ppr
Original file line number Diff line number Diff line change
1
+ module Compat.HieTypes
2
+ ( module GHC.Iface.Ext.Types ) where
3
+ import GHC.Iface.Ext.Types
Original file line number Diff line number Diff line change
1
+ module Compat.HieUtils
2
+ ( module GHC.Iface.Ext.Utils ) where
3
+ import GHC.Iface.Ext.Utils
You can’t perform that action at this time.
0 commit comments