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

Commit

Permalink
CPP imports + stack-8.8.1.yaml + ignore hie.yaml
Browse files Browse the repository at this point in the history
  • Loading branch information
Avi-D-coder committed Dec 23, 2019
1 parent f5f850f commit 69c9b1f
Show file tree
Hide file tree
Showing 19 changed files with 103 additions and 25 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -77,3 +77,4 @@ shake.yaml.lock

# ignore hie.yaml's for testdata
test/**/*.yaml
/hie.yaml
3 changes: 3 additions & 0 deletions app/MainHie.hs
Original file line number Diff line number Diff line change
@@ -1,9 +1,12 @@
{-# LANGUAGE CPP #-}
{-# LANGUAGE OverloadedStrings #-}
{-# LANGUAGE RankNTypes #-}
module Main where

import Control.Monad
#if __GLASGOW_HASKELL__ < 808
import Data.Monoid ((<>))
#endif
import Data.Version (showVersion)
import Haskell.Ide.Engine.MonadFunctions
import Haskell.Ide.Engine.MonadTypes
Expand Down
20 changes: 10 additions & 10 deletions haskell-ide-engine.cabal
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ build-type: Simple
cabal-version: >=2.0

flag pedantic
Description: Enable -Werror -Wwarn=unused-imports
Description: Enable -Werror
Default: False

library
Expand Down Expand Up @@ -102,7 +102,7 @@ library

ghc-options: -Wall -Wredundant-constraints
if flag(pedantic)
ghc-options: -Werror -Wwarn=unused-imports
ghc-options: -Werror
default-language: Haskell2010

executable hie
Expand All @@ -121,7 +121,7 @@ executable hie
ghc-options: -threaded -rtsopts -with-rtsopts=-N -Wall -Wredundant-constraints
-with-rtsopts=-T
if flag(pedantic)
ghc-options: -Werror -Wwarn=unused-imports
ghc-options: -Werror
default-language: Haskell2010


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

library hie-test-utils
Expand All @@ -168,7 +168,7 @@ library hie-test-utils
, yaml
ghc-options: -Wall -Wredundant-constraints
if flag(pedantic)
ghc-options: -Werror -Wwarn=unused-imports
ghc-options: -Werror
default-language: Haskell2010

test-suite unit-test
Expand Down Expand Up @@ -212,7 +212,7 @@ test-suite unit-test

ghc-options: -Wall -Wredundant-constraints
if flag(pedantic)
ghc-options: -Werror -Wwarn=unused-imports
ghc-options: -Werror
default-language: Haskell2010

test-suite dispatcher-test
Expand All @@ -236,7 +236,7 @@ test-suite dispatcher-test

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

Expand All @@ -256,7 +256,7 @@ test-suite plugin-dispatcher-test

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

test-suite func-test
Expand Down Expand Up @@ -301,7 +301,7 @@ test-suite func-test
, containers
ghc-options: -threaded -rtsopts -with-rtsopts=-N -Wall -Wredundant-constraints
if flag(pedantic)
ghc-options: -Werror -Wwarn=unused-imports
ghc-options: -Werror
default-language: Haskell2010
build-tool-depends: hspec-discover:hspec-discover
, haskell-ide-engine:hie
Expand All @@ -320,7 +320,7 @@ test-suite wrapper-test
, hie-plugin-api
ghc-options: -threaded -rtsopts -with-rtsopts=-N -Wall -Wredundant-constraints
if flag(pedantic)
ghc-options: -Werror -Wwarn=unused-imports
ghc-options: -Werror
default-language: Haskell2010


Expand Down
6 changes: 5 additions & 1 deletion hie-plugin-api/Haskell/Ide/Engine/Ghc.hs
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,6 @@ import Control.Monad ( when )
import Data.IORef
import qualified Data.Map.Strict as Map
-- import qualified Data.IntMap.Strict as IM
import Data.Semigroup ((<>), Semigroup)
import qualified Data.Set as Set
import qualified Data.Text as T
import qualified Data.Aeson
Expand All @@ -37,7 +36,12 @@ import Haskell.Ide.Engine.PluginUtils
import DynFlags
import GHC
import qualified HscTypes

#if __GLASGOW_HASKELL__ < 808
import Data.Semigroup ((<>), Semigroup)
import Outputable (renderWithStyle)
#endif

import Language.Haskell.LSP.Types ( NormalizedUri(..), toNormalizedUri )

import Haskell.Ide.Engine.GhcUtils
Expand Down
13 changes: 9 additions & 4 deletions hie-plugin-api/Haskell/Ide/Engine/PluginsIdeMonads.hs
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
{-# LANGUAGE CPP #-}
{-# LANGUAGE DeriveGeneric #-}
{-# LANGUAGE DeriveFunctor #-}
{-# LANGUAGE DeriveAnyClass #-}
Expand Down Expand Up @@ -112,12 +113,16 @@ import qualified Data.List as List
import Data.Dynamic ( Dynamic )
import qualified Data.Map as Map
import Data.Maybe
import Data.Monoid ( (<>) )

import qualified Data.Set as S
import qualified Data.Text as T
import Data.Typeable ( TypeRep
, Typeable
)
import Data.Typeable ( TypeRep )

#if __GLASGOW_HASKELL__ < 808
import Data.Monoid ( (<>) )
import Data.Typeable ( Typeable )
#endif

import System.Directory
import GhcMonad
import qualified HIE.Bios.Ghc.Api as BIOS
Expand Down
2 changes: 1 addition & 1 deletion install/shake.yaml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# Used to provide a different environment for the shake build script
resolver: lts-14.17 # GHC 8.6.5
resolver: lts-14.11 # GHC 8.6.5
packages:
- .

Expand Down
3 changes: 3 additions & 0 deletions src/Haskell/Ide/Engine/Completions.hs
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
{-# LANGUAGE CPP #-}
{-# LANGUAGE DeriveGeneric #-}
{-# LANGUAGE NamedFieldPuns #-}
{-# LANGUAGE OverloadedStrings #-}
Expand All @@ -23,7 +24,9 @@ import qualified Data.List as List
import qualified Data.Text as T
import qualified Data.Map as Map
import Data.Maybe
#if __GLASGOW_HASKELL__ < 808
import Data.Semigroup (Semigroup(..))
#endif
import Data.Typeable
import GHC.Generics ( Generic )

Expand Down
5 changes: 5 additions & 0 deletions src/Haskell/Ide/Engine/Plugin/ApplyRefact.hs
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
{-# LANGUAGE CPP #-}
{-# LANGUAGE DeriveAnyClass #-}
{-# LANGUAGE DeriveGeneric #-}
{-# LANGUAGE DuplicateRecordFields #-}
Expand All @@ -16,7 +17,11 @@ import Control.Monad.IO.Class
import Control.Monad.Trans.Except
import Data.Aeson hiding (Error)
import Data.Maybe

#if __GLASGOW_HASKELL__ < 808
import Data.Monoid ((<>))
#endif

import qualified Data.Text as T
import GHC.Generics
import Haskell.Ide.Engine.MonadFunctions
Expand Down
3 changes: 2 additions & 1 deletion src/Haskell/Ide/Engine/Plugin/Brittany.hs
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,8 @@ import Haskell.Ide.Engine.PluginUtils
import Language.Haskell.Brittany
import qualified Language.Haskell.LSP.Types as J
import qualified Language.Haskell.LSP.Types.Lens as J
import System.FilePath (FilePath, takeDirectory)

import System.FilePath
import Data.Maybe (maybeToList)

brittanyDescriptor :: PluginId -> PluginDescriptor
Expand Down
2 changes: 2 additions & 0 deletions src/Haskell/Ide/Engine/Plugin/Generic.hs
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,9 @@ import Data.Function
import qualified Data.HashMap.Strict as HM
import Data.List
import Data.Maybe
#if __GLASGOW_HASKELL__ < 808
import Data.Monoid ((<>))
#endif
import qualified Data.Text as T
import Name
import GHC.Generics
Expand Down
3 changes: 3 additions & 0 deletions src/Haskell/Ide/Engine/Plugin/HsImport.hs
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
{-# LANGUAGE CPP #-}
{-# LANGUAGE OverloadedStrings #-}
{-# LANGUAGE DeriveGeneric #-}
{-# LANGUAGE DeriveAnyClass #-}
Expand All @@ -10,7 +11,9 @@ import Control.Monad
import Data.Aeson
import Data.Foldable
import Data.Maybe
#if __GLASGOW_HASKELL__ < 808
import Data.Monoid ( (<>) )
#endif
import qualified Data.Text as T
import qualified Data.Text.IO as T
import qualified GHC.Generics as Generics
Expand Down
5 changes: 4 additions & 1 deletion src/Haskell/Ide/Engine/Plugin/Package.hs
Original file line number Diff line number Diff line change
Expand Up @@ -19,11 +19,14 @@ import qualified Data.ByteString as B
import Data.Foldable
import Data.List
import qualified Data.HashMap.Strict as HM
import qualified Data.Set as S
import qualified Data.Text as T
import qualified Data.Text.Encoding as T
import Data.Maybe
#if __GLASGOW_HASKELL__ < 808
import Data.Monoid ((<>))
#else
import qualified Data.Set as S
#endif
#if MIN_VERSION_Cabal(2,2,0)
import Distribution.PackageDescription.Parsec
import Distribution.Types.VersionRange
Expand Down
3 changes: 3 additions & 0 deletions src/Haskell/Ide/Engine/Plugin/Pragmas.hs
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
{-# LANGUAGE CPP #-}
{-# LANGUAGE DeriveAnyClass #-}
{-# LANGUAGE DeriveGeneric #-}
{-# LANGUAGE OverloadedStrings #-}
Expand All @@ -6,7 +7,9 @@ module Haskell.Ide.Engine.Plugin.Pragmas where
import Control.Lens
import Data.Aeson
import qualified Data.HashMap.Strict as H
#if __GLASGOW_HASKELL__ < 808
import Data.Monoid ((<>))
#endif
import qualified Data.Text as T
import qualified GHC.Generics as Generics
import Haskell.Ide.Engine.MonadTypes hiding (_range)
Expand Down
9 changes: 6 additions & 3 deletions src/Haskell/Ide/Engine/Scheduler.hs
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
{-# LANGUAGE CPP #-}
{-# LANGUAGE FlexibleContexts #-}
{-# LANGUAGE MultiParamTypeClasses #-}
{-# LANGUAGE ExistentialQuantification #-}
Expand Down Expand Up @@ -25,9 +26,11 @@ where
import Control.Concurrent.Async
import GHC.Conc
import qualified Control.Concurrent.STM as STM
import Control.Monad.IO.Class ( liftIO
, MonadIO
)
import Control.Monad.IO.Class ( MonadIO )
#if __GLASGOW_HASKELL__ < 808
import Control.Monad.IO.Class ( liftIO )
#endif

import Control.Monad.Reader.Class ( ask
, MonadReader
)
Expand Down
6 changes: 5 additions & 1 deletion src/Haskell/Ide/Engine/Server.hs
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
{-# LANGUAGE CPP #-}
{-# LANGUAGE DuplicateRecordFields #-}
{-# LANGUAGE GADTs #-}
{-# LANGUAGE RankNTypes #-}
Expand Down Expand Up @@ -32,7 +33,10 @@ import Data.Default
import Data.Foldable
import qualified Data.Map as Map
import Data.Maybe
import Data.Semigroup (Semigroup(..), Option(..), option)
import Data.Semigroup (Option(..), option)
#if __GLASGOW_HASKELL__ < 808
import Data.Semigroup (Semigroup(..), )
#endif
import qualified Data.Set as S
import qualified Data.SortedList as SL
import qualified Data.Text as T
Expand Down
5 changes: 4 additions & 1 deletion src/Haskell/Ide/Engine/Support/HieExtras.hs
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,11 @@ module Haskell.Ide.Engine.Support.HieExtras
, getFormattingPlugin
) where

#if __GLASGOW_HASKELL__ < 808
import Data.Semigroup (Semigroup(..))
import Var
#endif

import ConLike
import Control.Monad.Reader
import Control.Monad.Except
Expand Down Expand Up @@ -63,7 +67,6 @@ import Packages
import SrcLoc
import TcEnv
import Type
import Var
import Module hiding (getModule)

-- ---------------------------------------------------------------------
Expand Down
2 changes: 1 addition & 1 deletion stack-8.6.5.yaml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
resolver: lts-14.17
resolver: lts-14.16
packages:
- .
- hie-plugin-api
Expand Down
35 changes: 35 additions & 0 deletions stack-8.8.1.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
resolver: nightly-2019-12-18
packages:
- .
- hie-plugin-api

extra-deps:
# - ./submodules/HaRe
- ./submodules/cabal-helper
- ./submodules/ghc-mod/ghc-project-types
- ./submodules/apply-refact
- hie-bios-0.3.2
- bytestring-trie-0.2.5.0
- constrained-dynamic-0.1.0.0
- fclabels-2.0.3.3
- floskell-0.10.2
- fold-debounce-0.2.0.9
- haddock-api-2.23.0
- haddock-library-1.8.0
- hoogle-5.0.17.13
- hsimport-0.11.0
- monad-dijkstra-0.1.1.2

flags:
haskell-ide-engine:
pedantic: true
hie-plugin-api:
pedantic: true


# allow-newer: true

nix:
packages: [ icu libcxx zlib ]

concurrent-tests: false
2 changes: 1 addition & 1 deletion stack.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ flags:
pedantic: true


allow-newer: true
# allow-newer: true

nix:
packages: [ icu libcxx zlib ]
Expand Down

0 comments on commit 69c9b1f

Please sign in to comment.