-
-
Notifications
You must be signed in to change notification settings - Fork 391
hie-compat: Add basic support for ghc 9.0.1 #1635
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
Changes from all commits
974d330
52ad40f
60f78a1
5149eef
7083e2e
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
{- | ||
Forked from GHC v9.0.1 to work around the readFile side effect in mkHiefile | ||
|
||
Main functions for .hie file generation | ||
-} | ||
{- HLINT ignore -} | ||
{-# OPTIONS_GHC -Wno-incomplete-uni-patterns #-} | ||
|
||
module Compat.HieAst ( mkHieFile, enrichHie ) where | ||
|
||
import GHC.Data.Maybe (expectJust) | ||
import GHC.Driver.Types | ||
import GHC.Hs | ||
import GHC.Tc.Types (TcGblEnv) | ||
import GHC.Types.Avail (Avails) | ||
import GHC.Unit.Module (ml_hs_file) | ||
|
||
import GHC.Iface.Ext.Ast (enrichHie, mkHieFileWithSource) | ||
import GHC.Iface.Ext.Types | ||
|
||
import qualified Data.ByteString as BS | ||
|
||
|
||
type RenamedSource = ( HsGroup GhcRn, [LImportDecl GhcRn] | ||
, Maybe [(LIE GhcRn, Avails)] | ||
, Maybe LHsDocString ) | ||
|
||
-- | Construct an 'HieFile' from the outputs of the typechecker. | ||
mkHieFile :: ModSummary | ||
-> TcGblEnv | ||
-> RenamedSource | ||
-> BS.ByteString -> Hsc HieFile | ||
mkHieFile ms ts rs src = do | ||
let src_file = expectJust "mkHieFile" (ml_hs_file $ ms_location ms) | ||
mkHieFileWithSource src_file src ms ts rs |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
{- | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Does this need to be duplicated? I think it should be possible to just reexport There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Not sure. I just copied whatever was in the ghc-810 versions and updated it to the ghc-901 version. |
||
Binary serialization for .hie files. | ||
-} | ||
|
||
module Compat.HieBin ( module GHC.Iface.Ext.Binary) | ||
where | ||
|
||
import GHC.Iface.Ext.Binary |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
module Compat.HieDebug | ||
( module GHC.Iface.Ext.Debug | ||
, ppHie ) where | ||
import GHC.Iface.Ext.Debug | ||
|
||
import GHC.Iface.Ext.Types (HieAST) | ||
import GHC.Utils.Outputable (Outputable(ppr), SDoc) | ||
|
||
ppHie :: Outputable a => HieAST a -> SDoc | ||
ppHie = ppr |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
module Compat.HieTypes | ||
( module GHC.Iface.Ext.Types ) where | ||
import GHC.Iface.Ext.Types |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
module Compat.HieUtils | ||
( module GHC.Iface.Ext.Utils ) where | ||
import GHC.Iface.Ext.Utils |
Uh oh!
There was an error while loading. Please reload this page.