Skip to content

Commit 94a966d

Browse files
committed
Remove CPP by using higher bound for the lsp test component
This gets us the instance that we need. Users who just depend on the library component won't be affected by this and can continue to build with any aeson version.
1 parent c974bb0 commit 94a966d

File tree

2 files changed

+2
-12
lines changed

2 files changed

+2
-12
lines changed

lsp/lsp.cabal

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -112,7 +112,8 @@ test-suite unit-test
112112
WorkspaceEditSpec
113113
build-depends: base
114114
, QuickCheck
115-
, aeson
115+
-- for instance Arbitrary Value
116+
, aeson >= 2.0.3.0
116117
, containers
117118
, filepath
118119
, lsp

lsp/test/JsonSpec.hs

Lines changed: 0 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
{-# LANGUAGE CPP #-}
21
{-# LANGUAGE UndecidableInstances #-}
32
{-# LANGUAGE FlexibleContexts #-}
43
{-# LANGUAGE TypeInType #-}
@@ -160,16 +159,6 @@ smallList = resize 3 . listOf
160159
instance (Arbitrary a) => Arbitrary (List a) where
161160
arbitrary = List <$> arbitrary
162161

163-
#if !MIN_VERSION_aeson(2,0,3)
164-
instance Arbitrary J.Value where
165-
arbitrary = oneof
166-
[ J.String <$> arbitrary
167-
, J.Number <$> arbitrary
168-
, J.Bool <$> arbitrary
169-
, pure J.Null
170-
]
171-
#endif
172-
173162
-- ---------------------------------------------------------------------
174163

175164
instance Arbitrary DidChangeWatchedFilesRegistrationOptions where

0 commit comments

Comments
 (0)