Skip to content
This repository was archived by the owner on Oct 7, 2020. It is now read-only.

Commit 34be1b1

Browse files
committed
CPP imports + stack-8.8.1.yaml + ignore hie.yaml
1 parent a9f9422 commit 34be1b1

File tree

17 files changed

+99
-22
lines changed

17 files changed

+99
-22
lines changed

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -77,3 +77,4 @@ shake.yaml.lock
7777

7878
# ignore hie.yaml's for testdata
7979
test/**/*.yaml
80+
/hie.yaml

app/MainHie.hs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,12 @@
1+
{-# LANGUAGE CPP #-}
12
{-# LANGUAGE OverloadedStrings #-}
23
{-# LANGUAGE RankNTypes #-}
34
module Main where
45

56
import Control.Monad
7+
#if __GLASGOW_HASKELL__ < 808
68
import Data.Monoid ((<>))
9+
#endif
710
import Data.Version (showVersion)
811
import Haskell.Ide.Engine.MonadFunctions
912
import Haskell.Ide.Engine.MonadTypes

haskell-ide-engine.cabal

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ build-type: Simple
1414
cabal-version: >=2.0
1515

1616
flag pedantic
17-
Description: Enable -Werror -Wwarn=unused-imports
17+
Description: Enable -Werror
1818
Default: False
1919

2020
library
@@ -103,7 +103,7 @@ library
103103

104104
ghc-options: -Wall -Wredundant-constraints
105105
if flag(pedantic)
106-
ghc-options: -Werror -Wwarn=unused-imports
106+
ghc-options: -Werror
107107
default-language: Haskell2010
108108

109109
executable hie
@@ -122,7 +122,7 @@ executable hie
122122
ghc-options: -threaded -rtsopts -with-rtsopts=-N -Wall -Wredundant-constraints
123123
-with-rtsopts=-T
124124
if flag(pedantic)
125-
ghc-options: -Werror -Wwarn=unused-imports
125+
ghc-options: -Werror
126126
default-language: Haskell2010
127127

128128

@@ -143,7 +143,7 @@ executable hie-wrapper
143143
ghc-options: -threaded -rtsopts -with-rtsopts=-N -Wall -Wredundant-constraints
144144
-with-rtsopts=-T
145145
if flag(pedantic)
146-
ghc-options: -Werror -Wwarn=unused-imports
146+
ghc-options: -Werror
147147
default-language: Haskell2010
148148

149149
library hie-test-utils
@@ -169,7 +169,7 @@ library hie-test-utils
169169
, yaml
170170
ghc-options: -Wall -Wredundant-constraints
171171
if flag(pedantic)
172-
ghc-options: -Werror -Wwarn=unused-imports
172+
ghc-options: -Werror
173173
default-language: Haskell2010
174174

175175
test-suite unit-test
@@ -213,7 +213,7 @@ test-suite unit-test
213213

214214
ghc-options: -Wall -Wredundant-constraints
215215
if flag(pedantic)
216-
ghc-options: -Werror -Wwarn=unused-imports
216+
ghc-options: -Werror
217217
default-language: Haskell2010
218218

219219
test-suite dispatcher-test
@@ -237,7 +237,7 @@ test-suite dispatcher-test
237237

238238
ghc-options: -threaded -rtsopts -with-rtsopts=-N -Wall -Wredundant-constraints
239239
if flag(pedantic)
240-
ghc-options: -Werror -Wwarn=unused-imports
240+
ghc-options: -Werror
241241
default-language: Haskell2010
242242
build-tool-depends: hspec-discover:hspec-discover
243243

@@ -257,7 +257,7 @@ test-suite plugin-dispatcher-test
257257

258258
ghc-options: -threaded -rtsopts -with-rtsopts=-N -Wall -Wredundant-constraints
259259
if flag(pedantic)
260-
ghc-options: -Werror -Wwarn=unused-imports
260+
ghc-options: -Werror
261261
default-language: Haskell2010
262262

263263
test-suite func-test
@@ -302,7 +302,7 @@ test-suite func-test
302302
, containers
303303
ghc-options: -threaded -rtsopts -with-rtsopts=-N -Wall -Wredundant-constraints
304304
if flag(pedantic)
305-
ghc-options: -Werror -Wwarn=unused-imports
305+
ghc-options: -Werror
306306
default-language: Haskell2010
307307
build-tool-depends: hspec-discover:hspec-discover
308308
, haskell-ide-engine:hie
@@ -321,7 +321,7 @@ test-suite wrapper-test
321321
, hie-plugin-api
322322
ghc-options: -threaded -rtsopts -with-rtsopts=-N -Wall -Wredundant-constraints
323323
if flag(pedantic)
324-
ghc-options: -Werror -Wwarn=unused-imports
324+
ghc-options: -Werror
325325
default-language: Haskell2010
326326

327327

hie-plugin-api/Haskell/Ide/Engine/Ghc.hs

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,6 @@ import Control.Monad ( when )
2323
import Data.IORef
2424
import qualified Data.Map.Strict as Map
2525
import qualified Data.IntMap.Strict as IM
26-
import Data.Semigroup ((<>), Semigroup)
2726
import qualified Data.Set as Set
2827
import qualified Data.Text as T
2928
import qualified Data.Aeson
@@ -37,7 +36,12 @@ import Haskell.Ide.Engine.PluginUtils
3736
import DynFlags
3837
import GHC
3938
import qualified HscTypes
39+
40+
#if __GLASGOW_HASKELL__ < 808
41+
import Data.Semigroup ((<>), Semigroup)
4042
import Outputable (renderWithStyle)
43+
#endif
44+
4145
import Language.Haskell.LSP.Types ( NormalizedUri(..), toNormalizedUri )
4246

4347
import Haskell.Ide.Engine.GhcUtils

hie-plugin-api/Haskell/Ide/Engine/PluginsIdeMonads.hs

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
{-# LANGUAGE CPP #-}
12
{-# LANGUAGE DeriveGeneric #-}
23
{-# LANGUAGE DeriveFunctor #-}
34
{-# LANGUAGE DeriveAnyClass #-}
@@ -112,12 +113,16 @@ import qualified Data.List as List
112113
import Data.Dynamic ( Dynamic )
113114
import qualified Data.Map as Map
114115
import Data.Maybe
115-
import Data.Monoid ( (<>) )
116+
116117
import qualified Data.Set as S
117118
import qualified Data.Text as T
118-
import Data.Typeable ( TypeRep
119-
, Typeable
120-
)
119+
import Data.Typeable ( TypeRep )
120+
121+
#if __GLASGOW_HASKELL__ < 808
122+
import Data.Monoid ( (<>) )
123+
import Data.Typeable ( Typeable )
124+
#endif
125+
121126
import System.Directory
122127
import GhcMonad
123128
import qualified HIE.Bios.Ghc.Api as BIOS

src/Haskell/Ide/Engine/LSP/Completions.hs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
{-# LANGUAGE CPP #-}
12
{-# LANGUAGE DeriveGeneric #-}
23
{-# LANGUAGE NamedFieldPuns #-}
34
{-# LANGUAGE OverloadedStrings #-}
@@ -23,7 +24,9 @@ import qualified Data.List as List
2324
import qualified Data.Text as T
2425
import qualified Data.Map as Map
2526
import Data.Maybe
27+
#if __GLASGOW_HASKELL__ < 808
2628
import Data.Semigroup (Semigroup(..))
29+
#endif
2730
import Data.Typeable
2831
import GHC.Generics ( Generic )
2932

src/Haskell/Ide/Engine/Plugin/ApplyRefact.hs

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
{-# LANGUAGE CPP #-}
12
{-# LANGUAGE DeriveAnyClass #-}
23
{-# LANGUAGE DeriveGeneric #-}
34
{-# LANGUAGE DuplicateRecordFields #-}
@@ -16,7 +17,11 @@ import Control.Monad.IO.Class
1617
import Control.Monad.Trans.Except
1718
import Data.Aeson hiding (Error)
1819
import Data.Maybe
20+
21+
#if __GLASGOW_HASKELL__ < 808
1922
import Data.Monoid ((<>))
23+
#endif
24+
2025
import qualified Data.Text as T
2126
import GHC.Generics
2227
import Haskell.Ide.Engine.MonadFunctions

src/Haskell/Ide/Engine/Plugin/Brittany.hs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,8 @@ import Haskell.Ide.Engine.PluginUtils
1414
import Language.Haskell.Brittany
1515
import qualified Language.Haskell.LSP.Types as J
1616
import qualified Language.Haskell.LSP.Types.Lens as J
17-
import System.FilePath (FilePath, takeDirectory)
17+
18+
import System.FilePath
1819
import Data.Maybe (maybeToList)
1920

2021
brittanyDescriptor :: PluginId -> PluginDescriptor

src/Haskell/Ide/Engine/Plugin/Generic.hs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,9 @@ import Data.Function
1414
import qualified Data.HashMap.Strict as HM
1515
import Data.List
1616
import Data.Maybe
17+
#if __GLASGOW_HASKELL__ < 808
1718
import Data.Monoid ((<>))
19+
#endif
1820
import qualified Data.Text as T
1921
import Name
2022
import GHC.Generics

src/Haskell/Ide/Engine/Plugin/HsImport.hs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
{-# LANGUAGE CPP #-}
12
{-# LANGUAGE OverloadedStrings #-}
23
{-# LANGUAGE DeriveGeneric #-}
34
{-# LANGUAGE DeriveAnyClass #-}
@@ -10,7 +11,9 @@ import Control.Monad
1011
import Data.Aeson
1112
import Data.Foldable
1213
import Data.Maybe
14+
#if __GLASGOW_HASKELL__ < 808
1315
import Data.Monoid ( (<>) )
16+
#endif
1417
import qualified Data.Text as T
1518
import qualified Data.Text.IO as T
1619
import qualified GHC.Generics as Generics

0 commit comments

Comments
 (0)