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

Commit 69c9b1f

Browse files
committed
CPP imports + stack-8.8.1.yaml + ignore hie.yaml
1 parent f5f850f commit 69c9b1f

File tree

19 files changed

+103
-25
lines changed

19 files changed

+103
-25
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
@@ -102,7 +102,7 @@ library
102102

103103
ghc-options: -Wall -Wredundant-constraints
104104
if flag(pedantic)
105-
ghc-options: -Werror -Wwarn=unused-imports
105+
ghc-options: -Werror
106106
default-language: Haskell2010
107107

108108
executable hie
@@ -121,7 +121,7 @@ executable hie
121121
ghc-options: -threaded -rtsopts -with-rtsopts=-N -Wall -Wredundant-constraints
122122
-with-rtsopts=-T
123123
if flag(pedantic)
124-
ghc-options: -Werror -Wwarn=unused-imports
124+
ghc-options: -Werror
125125
default-language: Haskell2010
126126

127127

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

148148
library hie-test-utils
@@ -168,7 +168,7 @@ library hie-test-utils
168168
, yaml
169169
ghc-options: -Wall -Wredundant-constraints
170170
if flag(pedantic)
171-
ghc-options: -Werror -Wwarn=unused-imports
171+
ghc-options: -Werror
172172
default-language: Haskell2010
173173

174174
test-suite unit-test
@@ -212,7 +212,7 @@ test-suite unit-test
212212

213213
ghc-options: -Wall -Wredundant-constraints
214214
if flag(pedantic)
215-
ghc-options: -Werror -Wwarn=unused-imports
215+
ghc-options: -Werror
216216
default-language: Haskell2010
217217

218218
test-suite dispatcher-test
@@ -236,7 +236,7 @@ test-suite dispatcher-test
236236

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

@@ -256,7 +256,7 @@ test-suite plugin-dispatcher-test
256256

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

262262
test-suite func-test
@@ -301,7 +301,7 @@ test-suite func-test
301301
, containers
302302
ghc-options: -threaded -rtsopts -with-rtsopts=-N -Wall -Wredundant-constraints
303303
if flag(pedantic)
304-
ghc-options: -Werror -Wwarn=unused-imports
304+
ghc-options: -Werror
305305
default-language: Haskell2010
306306
build-tool-depends: hspec-discover:hspec-discover
307307
, haskell-ide-engine:hie
@@ -320,7 +320,7 @@ test-suite wrapper-test
320320
, hie-plugin-api
321321
ghc-options: -threaded -rtsopts -with-rtsopts=-N -Wall -Wredundant-constraints
322322
if flag(pedantic)
323-
ghc-options: -Werror -Wwarn=unused-imports
323+
ghc-options: -Werror
324324
default-language: Haskell2010
325325

326326

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

install/shake.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
# Used to provide a different environment for the shake build script
2-
resolver: lts-14.17 # GHC 8.6.5
2+
resolver: lts-14.11 # GHC 8.6.5
33
packages:
44
- .
55

src/Haskell/Ide/Engine/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

0 commit comments

Comments
 (0)