Skip to content

Commit d0534e6

Browse files
committed
Fix ghc-8.6.5 compatability
1 parent 28b3e83 commit d0534e6

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

ghcide/src/Development/IDE/GHC/Compat.hs

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@ module Development.IDE.GHC.Compat(
2626
#if !MIN_GHC_API_VERSION(8,8,0)
2727
ml_hie_file,
2828
addBootSuffixLocnOut,
29+
getRealSrcSpan,
2930
#endif
3031
hPutStringBuffer,
3132
addIncludePathsQuote,
@@ -108,7 +109,6 @@ module Development.IDE.GHC.Compat(
108109
oldListVisibleModuleNames,
109110
oldLookupModuleWithSuggestions,
110111

111-
getRealSpan,
112112
nodeInfo',
113113
getNodeIds,
114114
stringToUnit,
@@ -177,6 +177,7 @@ import DynamicLoading
177177
import Plugins (Plugin (parsedResultAction), withPlugins)
178178

179179
#if !MIN_GHC_API_VERSION(8,8,0)
180+
import SrcLoc (RealLocated)
180181
import System.FilePath ((-<.>))
181182
#endif
182183

@@ -463,6 +464,9 @@ disableWarningsAsErrors df =
463464
wopt_unset_fatal :: DynFlags -> WarningFlag -> DynFlags
464465
wopt_unset_fatal dfs f
465466
= dfs { fatalWarningFlags = EnumSet.delete f (fatalWarningFlags dfs) }
467+
468+
getRealSrcSpan :: RealLocated a -> RealSrcSpan
469+
getRealSrcSpan = GHC.getLoc
466470
#endif
467471

468472
applyPluginsParsedResultAction :: HscEnv -> DynFlags -> ModSummary -> ApiAnns -> ParsedSource -> IO ParsedSource
@@ -505,10 +509,6 @@ isQualifiedImport ImportDecl{ideclQualified} = ideclQualified
505509
#endif
506510
isQualifiedImport _ = False
507511

508-
getRealSpan :: SrcSpan -> Maybe RealSrcSpan
509-
getRealSpan (OldRealSrcSpan x) = Just x
510-
getRealSpan _ = Nothing
511-
512512

513513

514514
#if __GLASGOW_HASKELL__ >= 900

0 commit comments

Comments
 (0)