Skip to content

Commit f2c8ca3

Browse files
committed
Add BufSpan for lower version ghc
1 parent 8fbc1ea commit f2c8ca3

File tree

1 file changed

+5
-0
lines changed
  • plugins/hls-hlint-plugin/src/Ide/Plugin

1 file changed

+5
-0
lines changed

plugins/hls-hlint-plugin/src/Ide/Plugin/Hlint.hs

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,9 @@ import "ghc-lib" GHC hiding
7272
RealSrcSpan,
7373
ms_hspp_opts)
7474
import qualified "ghc-lib" GHC
75+
#if MIN_GHC_API_VERSION(9,0,0)
7576
import "ghc-lib" GHC.Types.SrcLoc (BufSpan)
77+
#endif
7678
import "ghc-lib-parser" GHC.LanguageExtensions (Extension)
7779
import Language.Haskell.GhclibParserEx.GHC.Driver.Session as GhclibParserEx (readExtension)
7880
import System.FilePath (takeFileName)
@@ -149,6 +151,9 @@ instance Pretty Log where
149151

150152
#ifdef HLINT_ON_GHC_LIB
151153
-- Reimplementing this, since the one in Development.IDE.GHC.Compat isn't for ghc-lib
154+
#if !MIN_GHC_API_VERSION(9,0,0)
155+
type BufSpan = ()
156+
#endif
152157
pattern RealSrcSpan :: GHC.RealSrcSpan -> Maybe BufSpan -> GHC.SrcSpan
153158
#if MIN_GHC_API_VERSION(9,0,0)
154159
pattern RealSrcSpan x y = GHC.RealSrcSpan x y

0 commit comments

Comments
 (0)