Skip to content

Commit b04dc3c

Browse files
FinleyMcIlwainewz1000
authored andcommitted
WIP 9.6 patches
1 parent 2e56ed4 commit b04dc3c

File tree

5 files changed

+32
-18
lines changed

5 files changed

+32
-18
lines changed

cabal.project

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ packages:
1515
-- ./plugins/hls-stylish-haskell-plugin
1616
-- ./plugins/hls-fourmolu-plugin
1717
./plugins/hls-class-plugin
18-
-- ./plugins/hls-eval-plugin
18+
./plugins/hls-eval-plugin
1919
./plugins/hls-explicit-imports-plugin
2020
-- ./plugins/hls-refine-imports-plugin
2121
-- ./plugins/hls-hlint-plugin

ghcide/src/Development/IDE/Core/Compile.hs

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -560,7 +560,7 @@ mkHiFileResultCompile se session' tcm simplified_guts = catchErrs $ do
560560
#else
561561
session
562562
#endif
563-
mod (ms_location ms)
563+
mod (ms_location ms)
564564

565565
-- Run corePrep first as we want to test the final version of the program that will
566566
-- get translated to STG/Bytecode
@@ -1591,7 +1591,10 @@ coreFileToCgGuts session iface details core_file = do
15911591
-- Implicit binds aren't saved, so we need to regenerate them ourselves.
15921592
let implicit_binds = concatMap getImplicitBinds tyCons
15931593
tyCons = typeEnvTyCons (md_types details)
1594-
#if MIN_VERSION_ghc(9,3,0)
1594+
#if MIN_VERSION_ghc(9,5,0)
1595+
-- In GHC 9.6, the implicit binds are tidied and part of core_binds
1596+
pure $ CgGuts this_mod tyCons core_binds [] NoStubs [] mempty (emptyHpcInfo False) Nothing []
1597+
#elif MIN_VERSION_ghc(9,3,0)
15951598
pure $ CgGuts this_mod tyCons (implicit_binds ++ core_binds) [] NoStubs [] mempty (emptyHpcInfo False) Nothing []
15961599
#else
15971600
pure $ CgGuts this_mod tyCons (implicit_binds ++ core_binds) NoStubs [] [] (emptyHpcInfo False) Nothing []

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

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -134,8 +134,12 @@ codeGutsToCoreFile
134134
:: Fingerprint -- ^ Hash of the interface this was generated from
135135
-> CgGuts
136136
-> CoreFile
137+
#if MIN_VERSION_ghc(9,5,0)
138+
-- In GHC 9.6, implicit binds are tidied and part of core binds
139+
codeGutsToCoreFile hash CgGuts{..} = CoreFile (map (toIfaceTopBind1 cg_module) cg_binds) hash
140+
#else
137141
codeGutsToCoreFile hash CgGuts{..} = CoreFile (map (toIfaceTopBind1 cg_module) $ filter isNotImplictBind cg_binds) hash
138-
142+
#endif
139143
-- | Implicit binds can be generated from the interface and are not tidied,
140144
-- so we must filter them out
141145
isNotImplictBind :: CoreBind -> Bool

ghcide/test/exe/Main.hs

Lines changed: 20 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -596,13 +596,19 @@ diagnosticTests = testGroup "diagnostics"
596596
expectDiagnostics
597597
[ ( "Main.hs"
598598
, [(DsError, (6, 9),
599-
if ghcVersion >= GHC94
600-
then "Variable not in scope: map" -- See https://gitlab.haskell.org/ghc/ghc/-/issues/22130
601-
else "Not in scope: \8216ThisList.map\8217")
599+
if ghcVersion >= GHC96 then
600+
"Variable not in scope: ThisList.map"
601+
else if ghcVersion >= GHC94 then
602+
"Variable not in scope: map" -- See https://gitlab.haskell.org/ghc/ghc/-/issues/22130
603+
else
604+
"Not in scope: \8216ThisList.map\8217")
602605
,(DsError, (7, 9),
603-
if ghcVersion >= GHC94
604-
then "Variable not in scope: x" -- See https://gitlab.haskell.org/ghc/ghc/-/issues/22130
605-
else "Not in scope: \8216BaseList.x\8217")
606+
if ghcVersion >= GHC96 then
607+
"Variable not in scope: BaseList.x"
608+
else if ghcVersion >= GHC94 then
609+
"Variable not in scope: x" -- See https://gitlab.haskell.org/ghc/ghc/-/issues/22130
610+
else
611+
"Not in scope: \8216BaseList.x\8217")
606612
]
607613
)
608614
]
@@ -950,7 +956,7 @@ addSigLensesTests =
950956
, ("head = 233", "head :: Integer")
951957
, ("rank2Test (k :: forall a . a -> a) = (k 233 :: Int, k \"QAQ\")", "rank2Test :: (forall a. a -> a) -> (Int, " <> listOfChar <> ")")
952958
, ("symbolKindTest = Proxy @\"qwq\"", "symbolKindTest :: Proxy \"qwq\"")
953-
, ("promotedKindTest = Proxy @Nothing", "promotedKindTest :: Proxy 'Nothing")
959+
, ("promotedKindTest = Proxy @Nothing", if ghcVersion >= GHC96 then "promotedKindTest :: Proxy Nothing" else "promotedKindTest :: Proxy 'Nothing")
954960
, ("typeOperatorTest = Refl", if ghcVersion >= GHC92 then "typeOperatorTest :: forall {k} {a :: k}. a :~: a" else "typeOperatorTest :: a :~: a")
955961
, ("notInScopeTest = mkCharType", "notInScopeTest :: String -> Data.Data.DataType")
956962
]
@@ -1768,7 +1774,7 @@ nonLocalCompletionTests =
17681774
[]
17691775
]
17701776
where
1771-
brokenForWinGhc = knownBrokenFor (BrokenSpecific Windows [GHC810, GHC90, GHC92, GHC94]) "Windows has strange things in scope for some reason"
1777+
brokenForWinGhc = knownBrokenFor (BrokenSpecific Windows [GHC810, GHC90, GHC92, GHC94, GHC96]) "Windows has strange things in scope for some reason"
17721778

17731779
otherCompletionTests :: [TestTree]
17741780
otherCompletionTests = [
@@ -2000,15 +2006,15 @@ completionDocTests =
20002006
, "bar = fo"
20012007
]
20022008
test doc (Position 2 8) "foo" Nothing ["*Defined at line 2, column 1 in this module*\n"]
2003-
, testSession "local single line doc without '\\n'" $ do
2009+
, testSession "local single line doc without newline" $ do
20042010
doc <- createDoc "A.hs" "haskell" $ T.unlines
20052011
[ "module A where"
20062012
, "-- |docdoc"
20072013
, "foo = ()"
20082014
, "bar = fo"
20092015
]
20102016
test doc (Position 3 8) "foo" Nothing ["*Defined at line 3, column 1 in this module*\n* * *\n\n\ndocdoc\n"]
2011-
, testSession "local multi line doc with '\\n'" $ do
2017+
, testSession "local multi line doc with newline" $ do
20122018
doc <- createDoc "A.hs" "haskell" $ T.unlines
20132019
[ "module A where"
20142020
, "-- | abcabc"
@@ -2017,7 +2023,7 @@ completionDocTests =
20172023
, "bar = fo"
20182024
]
20192025
test doc (Position 4 8) "foo" Nothing ["*Defined at line 4, column 1 in this module*\n* * *\n\n\nabcabc\n"]
2020-
, testSession "local multi line doc without '\\n'" $ do
2026+
, testSession "local multi line doc without newline" $ do
20212027
doc <- createDoc "A.hs" "haskell" $ T.unlines
20222028
[ "module A where"
20232029
, "-- | abcabc"
@@ -2057,10 +2063,10 @@ completionDocTests =
20572063
test doc (Position 1 7) "id" (Just $ T.length expected) [expected]
20582064
]
20592065
where
2060-
brokenForGhc9 = knownBrokenFor (BrokenForGHC [GHC90, GHC92, GHC94]) "Completion doc doesn't support ghc9"
2066+
brokenForGhc9 = knownBrokenFor (BrokenForGHC [GHC90, GHC92, GHC94, GHC96]) "Completion doc doesn't support ghc9"
20612067
brokenForWinGhc9 = knownBrokenFor (BrokenSpecific Windows [GHC90, GHC92]) "Extern doc doesn't support Windows for ghc9.2"
20622068
-- https://gitlab.haskell.org/ghc/ghc/-/issues/20903
2063-
brokenForMacGhc9 = knownBrokenFor (BrokenSpecific MacOS [GHC90, GHC92, GHC94]) "Extern doc doesn't support MacOS for ghc9"
2069+
brokenForMacGhc9 = knownBrokenFor (BrokenSpecific MacOS [GHC90, GHC92, GHC94, GHC96]) "Extern doc doesn't support MacOS for ghc9"
20642070
test doc pos label mn expected = do
20652071
_ <- waitForDiagnostics
20662072
compls <- getCompletions doc pos
@@ -2108,7 +2114,7 @@ highlightTests = testGroup "highlight"
21082114
, DocumentHighlight (R 6 10 6 13) (Just HkRead)
21092115
, DocumentHighlight (R 7 12 7 15) (Just HkRead)
21102116
]
2111-
, knownBrokenForGhcVersions [GHC90, GHC92, GHC94] "Ghc9 highlights the constructor and not just this field" $
2117+
, knownBrokenForGhcVersions [GHC90, GHC92, GHC94, GHC96] "Ghc9 highlights the constructor and not just this field" $
21122118
testSessionWait "record" $ do
21132119
doc <- createDoc "A.hs" "haskell" recsource
21142120
_ <- waitForDiagnostics

shake-bench/src/Development/Benchmark/Rules.hs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@
77
{-# LANGUAGE ExistentialQuantification #-}
88
{-# LANGUAGE OverloadedStrings #-}
99
{-# LANGUAGE RankNTypes #-}
10+
{-# LANGUAGE TypeOperators #-}
1011
{-# LANGUAGE TypeFamilies #-}
1112

1213
{- |

0 commit comments

Comments
 (0)