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
137
137
#if MIN_VERSION_ghc(9,5,0)
138
138
import GHC.Driver.Config.CoreToStg.Prep
139
139
import GHC.Core.Lint.Interactive
140
- import GHC.Driver.Main (mkCgInteractiveGuts )
141
- import GHC.Unit.Home.ModInfo
142
140
#endif
143
141
144
142
-- | 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 (
486
486
Extension (.. ),
487
487
#endif
488
488
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
489
498
) where
490
499
491
500
import qualified GHC
@@ -1187,4 +1196,29 @@ type UniqFM k = UniqFM.UniqFM
1187
1196
mkVisFunTys = mkScaledFunctionTys
1188
1197
mapLoc :: (a -> b ) -> SrcLoc. GenLocated l a -> SrcLoc. GenLocated l b
1189
1198
mapLoc = 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
1190
1224
#endif
Original file line number Diff line number Diff line change @@ -34,6 +34,7 @@ module Development.IDE.GHC.Compat.Outputable (
34
34
mkWarnMsg ,
35
35
mkSrcErr ,
36
36
srcErrorMessages ,
37
+ textDoc ,
37
38
) where
38
39
39
40
@@ -85,7 +86,7 @@ import GHC.Driver.Config.Diagnostic
85
86
import GHC.Utils.Logger
86
87
#endif
87
88
88
- #if MIN_VERSION_ghc(9,3 ,0)
89
+ #if MIN_VERSION_ghc(9,5 ,0)
89
90
type PrintUnqualified = NamePprCtx
90
91
#endif
91
92
@@ -247,3 +248,6 @@ defaultUserStyle = Out.defaultUserStyle
247
248
#else
248
249
defaultUserStyle = Out. defaultUserStyle unsafeGlobalDynFlags
249
250
#endif
251
+
252
+ textDoc :: String -> SDoc
253
+ textDoc = text
Original file line number Diff line number Diff line change 11
11
12
12
import Control.Monad.IO.Class
13
13
import Data.Functor
14
+ import Data.Foldable (toList )
14
15
import Data.Generics hiding (Prefix )
15
16
import Data.Maybe
16
17
import qualified Data.Text as T
@@ -30,7 +31,7 @@ import Language.LSP.Types (DocumentSymbol (..),
30
31
TextDocumentIdentifier (TextDocumentIdentifier ),
31
32
type (|? ) (InL ), uriToFilePath )
32
33
#if MIN_VERSION_ghc(9,2,0)
33
- import Data.List.NonEmpty (nonEmpty , toList )
34
+ import Data.List.NonEmpty (nonEmpty )
34
35
#endif
35
36
36
37
moduleOutline
Original file line number Diff line number Diff line change @@ -141,7 +141,11 @@ getCContext pos pm
141
141
importGo :: GHC. LImportDecl GhcPs -> Maybe Context
142
142
importGo (L (locA -> r) impDecl)
143
143
| pos `isInsideSrcSpan` r
144
+ #if MIN_VERSION_ghc(9,5,0)
144
145
= importInline importModuleName (fmap (fmap reLoc) $ ideclImportList impDecl)
146
+ #else
147
+ = importInline importModuleName (fmap (fmap reLoc) $ ideclHiding impDecl)
148
+ #endif
145
149
<|> Just (ImportContext importModuleName)
146
150
147
151
| otherwise = Nothing
Original file line number Diff line number Diff line change @@ -51,9 +51,9 @@ instance NFData ExportsMap where
51
51
instance Show ExportsMap where
52
52
show (ExportsMap occs mods) =
53
53
unwords [ " ExportsMap { getExportsMap ="
54
- , printWithoutUniques $ mapOccEnv (text @ SDoc . show ) occs
54
+ , printWithoutUniques $ mapOccEnv (textDoc . show ) occs
55
55
, " getModuleExportsMap ="
56
- , printWithoutUniques $ mapUFM (text @ SDoc . show ) mods
56
+ , printWithoutUniques $ mapUFM (textDoc . show ) mods
57
57
, " }"
58
58
]
59
59
You can’t perform that action at this time.
0 commit comments