Skip to content

Commit 41de40e

Browse files
authored
Remove more workarounds for GHCs < 9.2 (#4092) (#4098)
* Remove more workarounds for GHCs < 9.2 (#4092) * Delete removed module from cabal file * Remove unused package
1 parent 50923e5 commit 41de40e

29 files changed

+30
-221
lines changed

ghcide/ghcide.cabal

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -285,7 +285,7 @@ library ghcide-test-utils
285285
visibility: public
286286
default-language: GHC2021
287287

288-
hs-source-dirs: test/src test/cabal
288+
hs-source-dirs: test/src test/cabal
289289
exposed-modules:
290290
Development.IDE.Test
291291
Development.IDE.Test.Runfiles
@@ -306,14 +306,13 @@ library ghcide-test-utils
306306
lsp-test ^>= 0.17,
307307
tasty-hunit >= 0.10,
308308
text,
309-
row-types,
310309

311310
default-extensions:
312311
LambdaCase
313312
OverloadedStrings
314313
RecordWildCards
315314
ViewPatterns
316-
315+
317316
test-suite ghcide-tests
318317
import: warnings
319318
type: exitcode-stdio-1.0
@@ -365,7 +364,7 @@ test-suite ghcide-tests
365364
if impl(ghc <9.3)
366365
build-depends: ghc-typelits-knownnat
367366

368-
hs-source-dirs: test/exe
367+
hs-source-dirs: test/exe
369368
ghc-options: -threaded -O0
370369

371370
main-is: Main.hs
@@ -392,7 +391,6 @@ test-suite ghcide-tests
392391
NonLspCommandLine
393392
OpenCloseTest
394393
OutlineTests
395-
PluginParsedResultTests
396394
PluginSimpleTests
397395
PositionMappingTests
398396
PreprocessorTests

ghcide/test/data/plugin-recorddot/RecordDot.hs

Lines changed: 0 additions & 6 deletions
This file was deleted.

ghcide/test/data/plugin-recorddot/cabal.project

Lines changed: 0 additions & 1 deletion
This file was deleted.

ghcide/test/data/plugin-recorddot/plugin.cabal

Lines changed: 0 additions & 9 deletions
This file was deleted.

ghcide/test/exe/CodeLensTests.hs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -86,7 +86,7 @@ addSigLensesTests =
8686
, ("rank2Test (k :: forall a . a -> a) = (k 233 :: Int, k \"QAQ\")", "rank2Test :: (forall a. a -> a) -> (Int, String)")
8787
, ("symbolKindTest = Proxy @\"qwq\"", "symbolKindTest :: Proxy \"qwq\"")
8888
, ("promotedKindTest = Proxy @Nothing", if ghcVersion >= GHC96 then "promotedKindTest :: Proxy Nothing" else "promotedKindTest :: Proxy 'Nothing")
89-
, ("typeOperatorTest = Refl", if ghcVersion >= GHC92 then "typeOperatorTest :: forall {k} {a :: k}. a :~: a" else "typeOperatorTest :: a :~: a")
89+
, ("typeOperatorTest = Refl", "typeOperatorTest :: forall {k} {a :: k}. a :~: a")
9090
, ("notInScopeTest = mkCharType", "notInScopeTest :: String -> Data.Data.DataType")
9191
, ("aVeryLongSignature a b c d e f g h i j k l m n = a && b && c && d && e && f && g && h && i && j && k && l && m && n", "aVeryLongSignature :: Bool -> Bool -> Bool -> Bool -> Bool -> Bool -> Bool -> Bool -> Bool -> Bool -> Bool -> Bool -> Bool -> Bool -> Bool")
9292
]

ghcide/test/exe/DependentFileTest.hs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,6 @@ module DependentFileTest (tests) where
77
import Control.Monad.IO.Class (liftIO)
88
import Data.Row
99
import qualified Data.Text as T
10-
import Development.IDE.GHC.Compat (GhcVersion (..), ghcVersion)
1110
import Development.IDE.Test (expectDiagnostics)
1211
import Development.IDE.Types.Location
1312
import Language.LSP.Protocol.Message
@@ -45,7 +44,7 @@ tests = testGroup "addDependentFile"
4544
_ <- createDoc "Foo.hs" "haskell" fooContent
4645
doc <- createDoc "Baz.hs" "haskell" bazContent
4746
expectDiagnostics
48-
[("Foo.hs", [(DiagnosticSeverity_Error, if ghcVersion >= GHC92 then (4,11) else (4, 6), "Couldn't match type")])]
47+
[("Foo.hs", [(DiagnosticSeverity_Error, (4,11), "Couldn't match type")])]
4948
-- Now modify the dependent file
5049
liftIO $ writeFile depFilePath "B"
5150
sendNotification SMethod_WorkspaceDidChangeWatchedFiles $ DidChangeWatchedFilesParams

ghcide/test/exe/FindDefinitionAndHoverTests.hs

Lines changed: 7 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -113,13 +113,11 @@ tests = let
113113
typeDefinitionTests = [ tst (getTypeDefinitions, checkDefs) aaaL14 sourceFilePath (pure tcData) "Saturated data con"
114114
, tst (getTypeDefinitions, checkDefs) aL20 sourceFilePath (pure [ExpectNoDefinitions]) "Polymorphic variable"]
115115

116-
recordDotSyntaxTests
117-
| ghcVersion >= GHC92 =
118-
[ tst (getHover, checkHover) (Position 17 24) (T.unpack "RecordDotSyntax.hs") (pure [ExpectHoverText ["x :: MyRecord"]]) "hover over parent"
119-
, tst (getHover, checkHover) (Position 17 25) (T.unpack "RecordDotSyntax.hs") (pure [ExpectHoverText ["_ :: MyChild"]]) "hover over dot shows child"
120-
, tst (getHover, checkHover) (Position 17 26) (T.unpack "RecordDotSyntax.hs") (pure [ExpectHoverText ["_ :: MyChild"]]) "hover over child"
121-
]
122-
| otherwise = []
116+
recordDotSyntaxTests =
117+
[ tst (getHover, checkHover) (Position 17 24) (T.unpack "RecordDotSyntax.hs") (pure [ExpectHoverText ["x :: MyRecord"]]) "hover over parent"
118+
, tst (getHover, checkHover) (Position 17 25) (T.unpack "RecordDotSyntax.hs") (pure [ExpectHoverText ["_ :: MyChild"]]) "hover over dot shows child"
119+
, tst (getHover, checkHover) (Position 17 26) (T.unpack "RecordDotSyntax.hs") (pure [ExpectHoverText ["_ :: MyChild"]]) "hover over child"
120+
]
123121

124122
test runDef runHover look expect = testM runDef runHover look (return expect)
125123

@@ -157,8 +155,8 @@ tests = let
157155
spaceL37 = Position 41 24 ; space = [ExpectNoDefinitions, ExpectHoverText [":: Char"]]
158156
docL41 = Position 45 1 ; doc = [ExpectHoverText ["Recognizable docs: kpqz"]]
159157
; constr = [ExpectHoverText ["Monad m"]]
160-
eitL40 = Position 44 28 ; kindE = [ExpectHoverText [if ghcVersion >= GHC92 then ":: Type -> Type -> Type\n" else ":: * -> * -> *\n"]]
161-
intL40 = Position 44 34 ; kindI = [ExpectHoverText [if ghcVersion >= GHC92 then ":: Type\n" else ":: *\n"]]
158+
eitL40 = Position 44 28 ; kindE = [ExpectHoverText [":: Type -> Type -> Type\n"]]
159+
intL40 = Position 44 34 ; kindI = [ExpectHoverText [":: Type\n"]]
162160
tvrL40 = Position 44 37 ; kindV = [ExpectHoverText [":: * -> *\n"]]
163161
intL41 = Position 45 20 ; litI = [ExpectHoverText ["7518"]]
164162
chrL36 = Position 41 24 ; litC = [ExpectHoverText ["'f'"]]

ghcide/test/exe/Main.hs

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,6 @@ import OutlineTests
5656
import HighlightTests
5757
import FindDefinitionAndHoverTests
5858
import PluginSimpleTests
59-
import PluginParsedResultTests
6059
import PreprocessorTests
6160
import THTests
6261
import SymlinkTests
@@ -103,7 +102,6 @@ main = do
103102
, HighlightTests.tests
104103
, FindDefinitionAndHoverTests.tests
105104
, PluginSimpleTests.tests
106-
, PluginParsedResultTests.tests
107105
, PreprocessorTests.tests
108106
, THTests.tests
109107
, SymlinkTests.tests

ghcide/test/exe/PluginParsedResultTests.hs

Lines changed: 0 additions & 16 deletions
This file was deleted.

ghcide/test/exe/TestUtils.hs

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -163,9 +163,6 @@ xfail = flip expectFailBecause
163163
ignoreInWindowsBecause :: String -> TestTree -> TestTree
164164
ignoreInWindowsBecause = ignoreFor (BrokenForOS Windows)
165165

166-
ignoreForGHC92Plus :: String -> TestTree -> TestTree
167-
ignoreForGHC92Plus = ignoreFor (BrokenForGHC [GHC92, GHC94, GHC96, GHC98])
168-
169166
knownBrokenForGhcVersions :: [GhcVersion] -> String -> TestTree -> TestTree
170167
knownBrokenForGhcVersions ghcVers = knownBrokenFor (BrokenForGHC ghcVers)
171168

0 commit comments

Comments
 (0)