File tree Expand file tree Collapse file tree 6 files changed +47
-6
lines changed
ghcide/src/Development/IDE Expand file tree Collapse file tree 6 files changed +47
-6
lines changed Original file line number Diff line number Diff line change @@ -137,8 +137,6 @@ import qualified GHC.Types.Error as Error
137137#if MIN_VERSION_ghc(9,5,0)
138138import GHC.Driver.Config.CoreToStg.Prep
139139import GHC.Core.Lint.Interactive
140- import GHC.Driver.Main (mkCgInteractiveGuts )
141- import GHC.Unit.Home.ModInfo
142140#endif
143141
144142-- | Given a string buffer, return the string (after preprocessing) and the 'ParsedModule'.
Original file line number Diff line number Diff line change @@ -486,6 +486,15 @@ module Development.IDE.GHC.Compat.Core (
486486 Extension (.. ),
487487#endif
488488 UniqFM ,
489+ mkCgInteractiveGuts ,
490+ justBytecode ,
491+ justObjects ,
492+ emptyHomeModInfoLinkable ,
493+ homeModInfoByteCode ,
494+ homeModInfoObject ,
495+ # if !MIN_VERSION_ghc(9,5,0)
496+ field_label ,
497+ #endif
489498 ) where
490499
491500import qualified GHC
@@ -1187,4 +1196,29 @@ type UniqFM k = UniqFM.UniqFM
11871196mkVisFunTys = mkScaledFunctionTys
11881197mapLoc :: (a -> b ) -> SrcLoc. GenLocated l a -> SrcLoc. GenLocated l b
11891198mapLoc = fmap
1199+ #else
1200+ mapLoc :: (a -> b ) -> SrcLoc. GenLocated l a -> SrcLoc. GenLocated l b
1201+ mapLoc = SrcLoc. mapLoc
1202+ #endif
1203+
1204+
1205+ #if !MIN_VERSION_ghc(9,5,0)
1206+ mkCgInteractiveGuts :: CgGuts -> CgGuts
1207+ mkCgInteractiveGuts = id
1208+
1209+ emptyHomeModInfoLinkable :: Maybe Linkable
1210+ emptyHomeModInfoLinkable = Nothing
1211+
1212+ justBytecode :: Linkable -> Maybe Linkable
1213+ justBytecode = Just
1214+
1215+ justObjects :: Linkable -> Maybe Linkable
1216+ justObjects = Just
1217+
1218+ homeModInfoByteCode , homeModInfoObject :: HomeModInfo -> Maybe Linkable
1219+ homeModInfoByteCode = hm_linkable
1220+ homeModInfoObject = hm_linkable
1221+
1222+ field_label :: a -> a
1223+ field_label = id
11901224#endif
Original file line number Diff line number Diff line change @@ -34,6 +34,7 @@ module Development.IDE.GHC.Compat.Outputable (
3434 mkWarnMsg ,
3535 mkSrcErr ,
3636 srcErrorMessages ,
37+ textDoc ,
3738 ) where
3839
3940
@@ -85,7 +86,7 @@ import GHC.Driver.Config.Diagnostic
8586import GHC.Utils.Logger
8687#endif
8788
88- #if MIN_VERSION_ghc(9,3 ,0)
89+ #if MIN_VERSION_ghc(9,5 ,0)
8990type PrintUnqualified = NamePprCtx
9091#endif
9192
@@ -247,3 +248,6 @@ defaultUserStyle = Out.defaultUserStyle
247248#else
248249defaultUserStyle = Out. defaultUserStyle unsafeGlobalDynFlags
249250#endif
251+
252+ textDoc :: String -> SDoc
253+ textDoc = text
Original file line number Diff line number Diff line change 1111
1212import Control.Monad.IO.Class
1313import Data.Functor
14+ import Data.Foldable (toList )
1415import Data.Generics hiding (Prefix )
1516import Data.Maybe
1617import qualified Data.Text as T
@@ -30,7 +31,7 @@ import Language.LSP.Types (DocumentSymbol (..),
3031 TextDocumentIdentifier (TextDocumentIdentifier ),
3132 type (|? ) (InL ), uriToFilePath )
3233#if MIN_VERSION_ghc(9,2,0)
33- import Data.List.NonEmpty (nonEmpty , toList )
34+ import Data.List.NonEmpty (nonEmpty )
3435#endif
3536
3637moduleOutline
Original file line number Diff line number Diff line change @@ -141,7 +141,11 @@ getCContext pos pm
141141 importGo :: GHC. LImportDecl GhcPs -> Maybe Context
142142 importGo (L (locA -> r) impDecl)
143143 | pos `isInsideSrcSpan` r
144+ #if MIN_VERSION_ghc(9,5,0)
144145 = importInline importModuleName (fmap (fmap reLoc) $ ideclImportList impDecl)
146+ #else
147+ = importInline importModuleName (fmap (fmap reLoc) $ ideclHiding impDecl)
148+ #endif
145149 <|> Just (ImportContext importModuleName)
146150
147151 | otherwise = Nothing
Original file line number Diff line number Diff line change @@ -51,9 +51,9 @@ instance NFData ExportsMap where
5151instance Show ExportsMap where
5252 show (ExportsMap occs mods) =
5353 unwords [ " ExportsMap { getExportsMap ="
54- , printWithoutUniques $ mapOccEnv (text @ SDoc . show ) occs
54+ , printWithoutUniques $ mapOccEnv (textDoc . show ) occs
5555 , " getModuleExportsMap ="
56- , printWithoutUniques $ mapUFM (text @ SDoc . show ) mods
56+ , printWithoutUniques $ mapUFM (textDoc . show ) mods
5757 , " }"
5858 ]
5959
You can’t perform that action at this time.
0 commit comments