From a2eab3c9ac2704177eb15ce5585744cd2fce99df Mon Sep 17 00:00:00 2001 From: Avi Dessauer Date: Wed, 18 Dec 2019 07:49:20 -0500 Subject: [PATCH 01/20] Ghc 8.8.1 support --- .gitmodules | 4 +++ haskell-ide-engine.cabal | 20 +++++++------- install/shake.yaml | 2 +- src/Haskell/Ide/Engine/Plugin/Haddock.hs | 25 ++++++++++++++++- src/Haskell/Ide/Engine/Plugin/Package.hs | 5 ++++ src/Haskell/Ide/Engine/Support/HieExtras.hs | 5 ++++ stack-8.6.5.yaml | 2 +- stack.yaml | 30 +++++++-------------- submodules/apply-refact | 1 + 9 files changed, 61 insertions(+), 33 deletions(-) create mode 160000 submodules/apply-refact diff --git a/.gitmodules b/.gitmodules index ca9fce700..847bd7939 100644 --- a/.gitmodules +++ b/.gitmodules @@ -13,3 +13,7 @@ [submodule "submodules/cabal-helper"] path = submodules/cabal-helper url = https://github.com/DanielG/cabal-helper.git + +[submodule "submodules/apply-refact"] + path = submodules/apply-refact + url = https://github.com/mpickering/apply-refact.git diff --git a/haskell-ide-engine.cabal b/haskell-ide-engine.cabal index a229137fa..9dddfffb1 100644 --- a/haskell-ide-engine.cabal +++ b/haskell-ide-engine.cabal @@ -14,7 +14,7 @@ build-type: Simple cabal-version: >=2.0 flag pedantic - Description: Enable -Werror + Description: Enable -Werror -Wwarn=unused-imports Default: False library @@ -101,7 +101,7 @@ library ghc-options: -Wall -Wredundant-constraints if flag(pedantic) - ghc-options: -Werror + ghc-options: -Werror -Wwarn=unused-imports default-language: Haskell2010 executable hie @@ -120,7 +120,7 @@ executable hie ghc-options: -threaded -rtsopts -with-rtsopts=-N -Wall -Wredundant-constraints -with-rtsopts=-T if flag(pedantic) - ghc-options: -Werror + ghc-options: -Werror -Wwarn=unused-imports default-language: Haskell2010 @@ -141,7 +141,7 @@ executable hie-wrapper ghc-options: -threaded -rtsopts -with-rtsopts=-N -Wall -Wredundant-constraints -with-rtsopts=-T if flag(pedantic) - ghc-options: -Werror + ghc-options: -Werror -Wwarn=unused-imports default-language: Haskell2010 library hie-test-utils @@ -167,7 +167,7 @@ library hie-test-utils , yaml ghc-options: -Wall -Wredundant-constraints if flag(pedantic) - ghc-options: -Werror + ghc-options: -Werror -Wwarn=unused-imports default-language: Haskell2010 test-suite unit-test @@ -211,7 +211,7 @@ test-suite unit-test ghc-options: -Wall -Wredundant-constraints if flag(pedantic) - ghc-options: -Werror + ghc-options: -Werror -Wwarn=unused-imports default-language: Haskell2010 test-suite dispatcher-test @@ -235,7 +235,7 @@ test-suite dispatcher-test ghc-options: -threaded -rtsopts -with-rtsopts=-N -Wall -Wredundant-constraints if flag(pedantic) - ghc-options: -Werror + ghc-options: -Werror -Wwarn=unused-imports default-language: Haskell2010 build-tool-depends: hspec-discover:hspec-discover @@ -255,7 +255,7 @@ test-suite plugin-dispatcher-test ghc-options: -threaded -rtsopts -with-rtsopts=-N -Wall -Wredundant-constraints if flag(pedantic) - ghc-options: -Werror + ghc-options: -Werror -Wwarn=unused-imports default-language: Haskell2010 test-suite func-test @@ -300,7 +300,7 @@ test-suite func-test , containers ghc-options: -threaded -rtsopts -with-rtsopts=-N -Wall -Wredundant-constraints if flag(pedantic) - ghc-options: -Werror + ghc-options: -Werror -Wwarn=unused-imports default-language: Haskell2010 build-tool-depends: hspec-discover:hspec-discover , haskell-ide-engine:hie @@ -319,7 +319,7 @@ test-suite wrapper-test , hie-plugin-api ghc-options: -threaded -rtsopts -with-rtsopts=-N -Wall -Wredundant-constraints if flag(pedantic) - ghc-options: -Werror + ghc-options: -Werror -Wwarn=unused-imports default-language: Haskell2010 diff --git a/install/shake.yaml b/install/shake.yaml index 8c30114fa..22867942f 100644 --- a/install/shake.yaml +++ b/install/shake.yaml @@ -1,5 +1,5 @@ # Used to provide a different environment for the shake build script -resolver: lts-14.11 # GHC 8.6.5 +resolver: lts-14.17 # GHC 8.6.5 packages: - . diff --git a/src/Haskell/Ide/Engine/Plugin/Haddock.hs b/src/Haskell/Ide/Engine/Plugin/Haddock.hs index 2d41c7f45..1c1daef57 100644 --- a/src/Haskell/Ide/Engine/Plugin/Haddock.hs +++ b/src/Haskell/Ide/Engine/Plugin/Haddock.hs @@ -1,3 +1,4 @@ +{-# LANGUAGE CPP #-} {-# LANGUAGE OverloadedStrings #-} {-# LANGUAGE RankNTypes #-} {-# LANGUAGE ScopedTypeVariables #-} @@ -107,7 +108,11 @@ getDocsForName df name = do case mf of Nothing -> return Nothing Just f -> do +#if __GLASGOW_HASKELL__ >= 808 + ehi <- readInterfaceFile nameCacheFromIdeM f True +#else ehi <- readInterfaceFile nameCacheFromIdeM f +#endif case ehi of Left message -> do debugm $ "Haddock docs couldn't be loaded as readInterfaceFile failed with: " ++ message @@ -152,8 +157,15 @@ prettyprintType n t = T.unlines , "```\n" ] +unwrap :: Foldable w => w a -> a +unwrap = foldl1 (const id) + renderDocs :: MDoc Name -> T.Text +#if __GLASGOW_HASKELL__ >= 808 +renderDocs = markup renderMarkDown . _doc . fmap unwrap +#else renderDocs = markup renderMarkDown . _doc +#endif renderMarkDown :: DocMarkup Name T.Text renderMarkDown = @@ -162,7 +174,11 @@ renderMarkDown = , markupParagraph = (<> "\n\n") , markupAppend = mappend , markupIdentifier = surround "`" . T.pack . getOccString +#if __GLASGOW_HASKELL__ >= 808 + , markupIdentifierUnchecked = T.pack . occNameString . snd . unwrap +#else , markupIdentifierUnchecked = T.pack . occNameString . snd +#endif , markupModule = surround "**" . T.pack , markupWarning = surround "*" , markupEmphasis = surround "*" @@ -174,9 +190,16 @@ renderMarkDown = , markupDefList = T.unlines . map (\(a, b) -> a <> " :: " <> b) , markupCodeBlock = \x -> "\n```haskell\n" <> removeInner x <> "\n```\n" , markupHyperlink = \h -> - T.pack $ maybe +#if __GLASGOW_HASKELL__ >= 808 + let url = T.pack $ hyperlinkUrl h + in maybe + url + (\l -> "["<>l<>"]("<>url<>")") +#else + T.pack $ maybe (hyperlinkUrl h) (\l -> "["<>l<>"]("<>hyperlinkUrl h<>")") +#endif (hyperlinkLabel h) , markupAName = T.pack , markupPic = const "" diff --git a/src/Haskell/Ide/Engine/Plugin/Package.hs b/src/Haskell/Ide/Engine/Plugin/Package.hs index 28580d4b6..199485384 100644 --- a/src/Haskell/Ide/Engine/Plugin/Package.hs +++ b/src/Haskell/Ide/Engine/Plugin/Package.hs @@ -22,6 +22,7 @@ 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 @@ -297,7 +298,11 @@ editCabalPackage file modulePath pkgName fileMap = do -- Add it to the bottom of the dependencies list -- TODO: we could sort the depencies and then insert it, -- or insert it in order iff the list is already sorted. +#if __GLASGOW_HASKELL__ >= 808 + newDeps = oldDeps ++ [Dependency (mkPackageName (T.unpack dep)) anyVersion S.empty] +#else newDeps = oldDeps ++ [Dependency (mkPackageName (T.unpack dep)) anyVersion] +#endif -- | Provide a code action to add a package to the local package.yaml or cabal file. -- Reads from diagnostics the unknown import module path and searches for it on Hoogle. diff --git a/src/Haskell/Ide/Engine/Support/HieExtras.hs b/src/Haskell/Ide/Engine/Support/HieExtras.hs index b03876000..831f256b3 100644 --- a/src/Haskell/Ide/Engine/Support/HieExtras.hs +++ b/src/Haskell/Ide/Engine/Support/HieExtras.hs @@ -1,3 +1,4 @@ +{-# LANGUAGE CPP #-} {-# LANGUAGE DeriveGeneric #-} {-# LANGUAGE NamedFieldPuns #-} {-# LANGUAGE ScopedTypeVariables #-} @@ -336,7 +337,11 @@ gotoModule rfm mn = do flushFinderCaches env findImportedModule env mn Nothing case fr of +#if __GLASGOW_HASKELL__ < 808 Found (ModLocation (Just src) _ _) _ -> do +#else + Found (ModLocation (Just src) _ _ _) _ -> do +#endif fp <- reverseMapFile rfm src let r = Range (Position 0 0) (Position 0 0) diff --git a/stack-8.6.5.yaml b/stack-8.6.5.yaml index 4e9052e19..91b637b69 100644 --- a/stack-8.6.5.yaml +++ b/stack-8.6.5.yaml @@ -1,4 +1,4 @@ -resolver: lts-14.16 +resolver: lts-14.17 packages: - . - hie-plugin-api diff --git a/stack.yaml b/stack.yaml index 0a1737345..a891f03cf 100644 --- a/stack.yaml +++ b/stack.yaml @@ -1,4 +1,4 @@ -resolver: nightly-2019-09-21 # Last GHC 8.6.5 +resolver: nightly-2019-12-18 packages: - . - hie-plugin-api @@ -6,31 +6,21 @@ packages: extra-deps: # - ./submodules/HaRe - ./submodules/cabal-helper +- ./submodules/apply-refact - deque-0.4.3 - ansi-terminal-0.8.2 +- hie-bios-0.3.2 - bytestring-trie-0.2.5.0 -- ansi-wl-pprint-0.6.8.2 -- brittany-0.12.1.0 -- cabal-plan-0.5.0.0 - constrained-dynamic-0.1.0.0 +- fclabels-2.0.3.3 - floskell-0.10.2 -- ghc-lib-parser-8.8.1 -- haddock-api-2.22.0 -- haskell-lsp-0.19.0.0 -- haskell-lsp-types-0.19.0.0 -- hie-bios-0.3.2 -- hlint-2.2.4 +- 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 -- lsp-test-0.9.0.0 -- monad-dijkstra-0.1.1.2@rev:1 -- syz-0.2.0.0 -- temporary-1.2.1.1 -- clock-0.7.2 -- ghc-exactprint-0.6.2 # for HaRe -- extra-1.6.18 -- unix-compat-0.5.2 -- yaml-0.11.1.2 +- monad-dijkstra-0.1.1.2 flags: haskell-ide-engine: @@ -39,7 +29,7 @@ flags: pedantic: true -# allow-newer: true +allow-newer: true nix: packages: [ icu libcxx zlib ] diff --git a/submodules/apply-refact b/submodules/apply-refact new file mode 160000 index 000000000..1acf7eb86 --- /dev/null +++ b/submodules/apply-refact @@ -0,0 +1 @@ +Subproject commit 1acf7eb860be5a446828a3a2fe3644aeb5a1b55f From 40df38ae65ad457bbcaf3f03ac281469ce712012 Mon Sep 17 00:00:00 2001 From: Avi Dessauer Date: Fri, 20 Dec 2019 07:19:10 -0500 Subject: [PATCH 02/20] Use per-file pragma --- app/MainHie.hs | 1 + haskell-ide-engine.cabal | 20 +++++++++---------- hie-plugin-api/Haskell/Ide/Engine/Ghc.hs | 1 + .../Haskell/Ide/Engine/PluginsIdeMonads.hs | 1 + src/Haskell/Ide/Engine/Completions.hs | 1 + src/Haskell/Ide/Engine/Plugin/ApplyRefact.hs | 1 + src/Haskell/Ide/Engine/Plugin/Brittany.hs | 1 + src/Haskell/Ide/Engine/Plugin/Generic.hs | 1 + src/Haskell/Ide/Engine/Plugin/HsImport.hs | 1 + src/Haskell/Ide/Engine/Plugin/Package.hs | 1 + src/Haskell/Ide/Engine/Plugin/Pragmas.hs | 1 + src/Haskell/Ide/Engine/Scheduler.hs | 1 + src/Haskell/Ide/Engine/Server.hs | 1 + src/Haskell/Ide/Engine/Support/HieExtras.hs | 1 + 14 files changed, 23 insertions(+), 10 deletions(-) diff --git a/app/MainHie.hs b/app/MainHie.hs index dd7833567..074ff1e49 100644 --- a/app/MainHie.hs +++ b/app/MainHie.hs @@ -1,3 +1,4 @@ +{-# OPTIONS_GHC -fno-warn-unused-imports #-} {-# LANGUAGE OverloadedStrings #-} {-# LANGUAGE RankNTypes #-} module Main where diff --git a/haskell-ide-engine.cabal b/haskell-ide-engine.cabal index 9dddfffb1..a229137fa 100644 --- a/haskell-ide-engine.cabal +++ b/haskell-ide-engine.cabal @@ -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 @@ -101,7 +101,7 @@ library ghc-options: -Wall -Wredundant-constraints if flag(pedantic) - ghc-options: -Werror -Wwarn=unused-imports + ghc-options: -Werror default-language: Haskell2010 executable hie @@ -120,7 +120,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 @@ -141,7 +141,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 @@ -167,7 +167,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 @@ -211,7 +211,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 @@ -235,7 +235,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 @@ -255,7 +255,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 @@ -300,7 +300,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 @@ -319,7 +319,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 diff --git a/hie-plugin-api/Haskell/Ide/Engine/Ghc.hs b/hie-plugin-api/Haskell/Ide/Engine/Ghc.hs index 1ec624b5c..ff5e6db4e 100644 --- a/hie-plugin-api/Haskell/Ide/Engine/Ghc.hs +++ b/hie-plugin-api/Haskell/Ide/Engine/Ghc.hs @@ -1,3 +1,4 @@ +{-# OPTIONS_GHC -fno-warn-unused-imports #-} {-# LANGUAGE CPP #-} {-# LANGUAGE FlexibleContexts #-} {-# LANGUAGE OverloadedStrings #-} diff --git a/hie-plugin-api/Haskell/Ide/Engine/PluginsIdeMonads.hs b/hie-plugin-api/Haskell/Ide/Engine/PluginsIdeMonads.hs index 007f02ad1..d263d62ff 100644 --- a/hie-plugin-api/Haskell/Ide/Engine/PluginsIdeMonads.hs +++ b/hie-plugin-api/Haskell/Ide/Engine/PluginsIdeMonads.hs @@ -1,3 +1,4 @@ +{-# OPTIONS_GHC -fno-warn-unused-imports #-} {-# LANGUAGE DeriveGeneric #-} {-# LANGUAGE DeriveFunctor #-} {-# LANGUAGE DeriveAnyClass #-} diff --git a/src/Haskell/Ide/Engine/Completions.hs b/src/Haskell/Ide/Engine/Completions.hs index c1234bb87..c9fca07ba 100644 --- a/src/Haskell/Ide/Engine/Completions.hs +++ b/src/Haskell/Ide/Engine/Completions.hs @@ -1,3 +1,4 @@ +{-# OPTIONS_GHC -fno-warn-unused-imports #-} {-# LANGUAGE DeriveGeneric #-} {-# LANGUAGE NamedFieldPuns #-} {-# LANGUAGE OverloadedStrings #-} diff --git a/src/Haskell/Ide/Engine/Plugin/ApplyRefact.hs b/src/Haskell/Ide/Engine/Plugin/ApplyRefact.hs index 884bbca38..788c43a48 100644 --- a/src/Haskell/Ide/Engine/Plugin/ApplyRefact.hs +++ b/src/Haskell/Ide/Engine/Plugin/ApplyRefact.hs @@ -1,3 +1,4 @@ +{-# OPTIONS_GHC -fno-warn-unused-imports #-} {-# LANGUAGE DeriveAnyClass #-} {-# LANGUAGE DeriveGeneric #-} {-# LANGUAGE DuplicateRecordFields #-} diff --git a/src/Haskell/Ide/Engine/Plugin/Brittany.hs b/src/Haskell/Ide/Engine/Plugin/Brittany.hs index 222ddb333..4b3b95e22 100644 --- a/src/Haskell/Ide/Engine/Plugin/Brittany.hs +++ b/src/Haskell/Ide/Engine/Plugin/Brittany.hs @@ -1,3 +1,4 @@ +{-# OPTIONS_GHC -fno-warn-unused-imports #-} {-# LANGUAGE OverloadedStrings #-} -- | Brittany is a tool to format source code. module Haskell.Ide.Engine.Plugin.Brittany where diff --git a/src/Haskell/Ide/Engine/Plugin/Generic.hs b/src/Haskell/Ide/Engine/Plugin/Generic.hs index f613bf797..b5b5774e4 100644 --- a/src/Haskell/Ide/Engine/Plugin/Generic.hs +++ b/src/Haskell/Ide/Engine/Plugin/Generic.hs @@ -1,3 +1,4 @@ +{-# OPTIONS_GHC -fno-warn-unused-imports #-} {-# LANGUAGE CPP #-} {-# LANGUAGE DeriveGeneric #-} {-# LANGUAGE FlexibleContexts #-} diff --git a/src/Haskell/Ide/Engine/Plugin/HsImport.hs b/src/Haskell/Ide/Engine/Plugin/HsImport.hs index 935f013f7..cee7a4d45 100644 --- a/src/Haskell/Ide/Engine/Plugin/HsImport.hs +++ b/src/Haskell/Ide/Engine/Plugin/HsImport.hs @@ -1,3 +1,4 @@ +{-# OPTIONS_GHC -fno-warn-unused-imports #-} {-# LANGUAGE OverloadedStrings #-} {-# LANGUAGE DeriveGeneric #-} {-# LANGUAGE DeriveAnyClass #-} diff --git a/src/Haskell/Ide/Engine/Plugin/Package.hs b/src/Haskell/Ide/Engine/Plugin/Package.hs index 199485384..5c46e1b78 100644 --- a/src/Haskell/Ide/Engine/Plugin/Package.hs +++ b/src/Haskell/Ide/Engine/Plugin/Package.hs @@ -1,3 +1,4 @@ +{-# OPTIONS_GHC -fno-warn-unused-imports #-} {-# LANGUAGE CPP #-} {-# LANGUAGE OverloadedStrings #-} {-# LANGUAGE DeriveGeneric #-} diff --git a/src/Haskell/Ide/Engine/Plugin/Pragmas.hs b/src/Haskell/Ide/Engine/Plugin/Pragmas.hs index f33c6aef2..0e84633d3 100644 --- a/src/Haskell/Ide/Engine/Plugin/Pragmas.hs +++ b/src/Haskell/Ide/Engine/Plugin/Pragmas.hs @@ -1,3 +1,4 @@ +{-# OPTIONS_GHC -fno-warn-unused-imports #-} {-# LANGUAGE DeriveAnyClass #-} {-# LANGUAGE DeriveGeneric #-} {-# LANGUAGE OverloadedStrings #-} diff --git a/src/Haskell/Ide/Engine/Scheduler.hs b/src/Haskell/Ide/Engine/Scheduler.hs index a94787487..42f1e4520 100644 --- a/src/Haskell/Ide/Engine/Scheduler.hs +++ b/src/Haskell/Ide/Engine/Scheduler.hs @@ -1,3 +1,4 @@ +{-# OPTIONS_GHC -fno-warn-unused-imports #-} {-# LANGUAGE FlexibleContexts #-} {-# LANGUAGE MultiParamTypeClasses #-} {-# LANGUAGE ExistentialQuantification #-} diff --git a/src/Haskell/Ide/Engine/Server.hs b/src/Haskell/Ide/Engine/Server.hs index 9e4d51af9..71e6a8dc2 100644 --- a/src/Haskell/Ide/Engine/Server.hs +++ b/src/Haskell/Ide/Engine/Server.hs @@ -1,3 +1,4 @@ +{-# OPTIONS_GHC -fno-warn-unused-imports #-} {-# LANGUAGE DuplicateRecordFields #-} {-# LANGUAGE GADTs #-} {-# LANGUAGE RankNTypes #-} diff --git a/src/Haskell/Ide/Engine/Support/HieExtras.hs b/src/Haskell/Ide/Engine/Support/HieExtras.hs index 831f256b3..74821a660 100644 --- a/src/Haskell/Ide/Engine/Support/HieExtras.hs +++ b/src/Haskell/Ide/Engine/Support/HieExtras.hs @@ -1,3 +1,4 @@ +{-# OPTIONS_GHC -fno-warn-unused-imports #-} {-# LANGUAGE CPP #-} {-# LANGUAGE DeriveGeneric #-} {-# LANGUAGE NamedFieldPuns #-} From 42fb39de94a5f492e7741e727560530abbb5851e Mon Sep 17 00:00:00 2001 From: Avi Dessauer Date: Sat, 21 Dec 2019 17:42:27 -0500 Subject: [PATCH 03/20] Revert "Use per-file pragma" This reverts commit 61192eae6b41e9eac34c41a4686c550d8d99b1af. --- app/MainHie.hs | 1 - haskell-ide-engine.cabal | 20 +++++++++---------- hie-plugin-api/Haskell/Ide/Engine/Ghc.hs | 1 - .../Haskell/Ide/Engine/PluginsIdeMonads.hs | 1 - src/Haskell/Ide/Engine/Completions.hs | 1 - src/Haskell/Ide/Engine/Plugin/ApplyRefact.hs | 1 - src/Haskell/Ide/Engine/Plugin/Brittany.hs | 1 - src/Haskell/Ide/Engine/Plugin/Generic.hs | 1 - src/Haskell/Ide/Engine/Plugin/HsImport.hs | 1 - src/Haskell/Ide/Engine/Plugin/Package.hs | 1 - src/Haskell/Ide/Engine/Plugin/Pragmas.hs | 1 - src/Haskell/Ide/Engine/Scheduler.hs | 1 - src/Haskell/Ide/Engine/Server.hs | 1 - src/Haskell/Ide/Engine/Support/HieExtras.hs | 1 - 14 files changed, 10 insertions(+), 23 deletions(-) diff --git a/app/MainHie.hs b/app/MainHie.hs index 074ff1e49..dd7833567 100644 --- a/app/MainHie.hs +++ b/app/MainHie.hs @@ -1,4 +1,3 @@ -{-# OPTIONS_GHC -fno-warn-unused-imports #-} {-# LANGUAGE OverloadedStrings #-} {-# LANGUAGE RankNTypes #-} module Main where diff --git a/haskell-ide-engine.cabal b/haskell-ide-engine.cabal index a229137fa..9dddfffb1 100644 --- a/haskell-ide-engine.cabal +++ b/haskell-ide-engine.cabal @@ -14,7 +14,7 @@ build-type: Simple cabal-version: >=2.0 flag pedantic - Description: Enable -Werror + Description: Enable -Werror -Wwarn=unused-imports Default: False library @@ -101,7 +101,7 @@ library ghc-options: -Wall -Wredundant-constraints if flag(pedantic) - ghc-options: -Werror + ghc-options: -Werror -Wwarn=unused-imports default-language: Haskell2010 executable hie @@ -120,7 +120,7 @@ executable hie ghc-options: -threaded -rtsopts -with-rtsopts=-N -Wall -Wredundant-constraints -with-rtsopts=-T if flag(pedantic) - ghc-options: -Werror + ghc-options: -Werror -Wwarn=unused-imports default-language: Haskell2010 @@ -141,7 +141,7 @@ executable hie-wrapper ghc-options: -threaded -rtsopts -with-rtsopts=-N -Wall -Wredundant-constraints -with-rtsopts=-T if flag(pedantic) - ghc-options: -Werror + ghc-options: -Werror -Wwarn=unused-imports default-language: Haskell2010 library hie-test-utils @@ -167,7 +167,7 @@ library hie-test-utils , yaml ghc-options: -Wall -Wredundant-constraints if flag(pedantic) - ghc-options: -Werror + ghc-options: -Werror -Wwarn=unused-imports default-language: Haskell2010 test-suite unit-test @@ -211,7 +211,7 @@ test-suite unit-test ghc-options: -Wall -Wredundant-constraints if flag(pedantic) - ghc-options: -Werror + ghc-options: -Werror -Wwarn=unused-imports default-language: Haskell2010 test-suite dispatcher-test @@ -235,7 +235,7 @@ test-suite dispatcher-test ghc-options: -threaded -rtsopts -with-rtsopts=-N -Wall -Wredundant-constraints if flag(pedantic) - ghc-options: -Werror + ghc-options: -Werror -Wwarn=unused-imports default-language: Haskell2010 build-tool-depends: hspec-discover:hspec-discover @@ -255,7 +255,7 @@ test-suite plugin-dispatcher-test ghc-options: -threaded -rtsopts -with-rtsopts=-N -Wall -Wredundant-constraints if flag(pedantic) - ghc-options: -Werror + ghc-options: -Werror -Wwarn=unused-imports default-language: Haskell2010 test-suite func-test @@ -300,7 +300,7 @@ test-suite func-test , containers ghc-options: -threaded -rtsopts -with-rtsopts=-N -Wall -Wredundant-constraints if flag(pedantic) - ghc-options: -Werror + ghc-options: -Werror -Wwarn=unused-imports default-language: Haskell2010 build-tool-depends: hspec-discover:hspec-discover , haskell-ide-engine:hie @@ -319,7 +319,7 @@ test-suite wrapper-test , hie-plugin-api ghc-options: -threaded -rtsopts -with-rtsopts=-N -Wall -Wredundant-constraints if flag(pedantic) - ghc-options: -Werror + ghc-options: -Werror -Wwarn=unused-imports default-language: Haskell2010 diff --git a/hie-plugin-api/Haskell/Ide/Engine/Ghc.hs b/hie-plugin-api/Haskell/Ide/Engine/Ghc.hs index ff5e6db4e..1ec624b5c 100644 --- a/hie-plugin-api/Haskell/Ide/Engine/Ghc.hs +++ b/hie-plugin-api/Haskell/Ide/Engine/Ghc.hs @@ -1,4 +1,3 @@ -{-# OPTIONS_GHC -fno-warn-unused-imports #-} {-# LANGUAGE CPP #-} {-# LANGUAGE FlexibleContexts #-} {-# LANGUAGE OverloadedStrings #-} diff --git a/hie-plugin-api/Haskell/Ide/Engine/PluginsIdeMonads.hs b/hie-plugin-api/Haskell/Ide/Engine/PluginsIdeMonads.hs index d263d62ff..007f02ad1 100644 --- a/hie-plugin-api/Haskell/Ide/Engine/PluginsIdeMonads.hs +++ b/hie-plugin-api/Haskell/Ide/Engine/PluginsIdeMonads.hs @@ -1,4 +1,3 @@ -{-# OPTIONS_GHC -fno-warn-unused-imports #-} {-# LANGUAGE DeriveGeneric #-} {-# LANGUAGE DeriveFunctor #-} {-# LANGUAGE DeriveAnyClass #-} diff --git a/src/Haskell/Ide/Engine/Completions.hs b/src/Haskell/Ide/Engine/Completions.hs index c9fca07ba..c1234bb87 100644 --- a/src/Haskell/Ide/Engine/Completions.hs +++ b/src/Haskell/Ide/Engine/Completions.hs @@ -1,4 +1,3 @@ -{-# OPTIONS_GHC -fno-warn-unused-imports #-} {-# LANGUAGE DeriveGeneric #-} {-# LANGUAGE NamedFieldPuns #-} {-# LANGUAGE OverloadedStrings #-} diff --git a/src/Haskell/Ide/Engine/Plugin/ApplyRefact.hs b/src/Haskell/Ide/Engine/Plugin/ApplyRefact.hs index 788c43a48..884bbca38 100644 --- a/src/Haskell/Ide/Engine/Plugin/ApplyRefact.hs +++ b/src/Haskell/Ide/Engine/Plugin/ApplyRefact.hs @@ -1,4 +1,3 @@ -{-# OPTIONS_GHC -fno-warn-unused-imports #-} {-# LANGUAGE DeriveAnyClass #-} {-# LANGUAGE DeriveGeneric #-} {-# LANGUAGE DuplicateRecordFields #-} diff --git a/src/Haskell/Ide/Engine/Plugin/Brittany.hs b/src/Haskell/Ide/Engine/Plugin/Brittany.hs index 4b3b95e22..222ddb333 100644 --- a/src/Haskell/Ide/Engine/Plugin/Brittany.hs +++ b/src/Haskell/Ide/Engine/Plugin/Brittany.hs @@ -1,4 +1,3 @@ -{-# OPTIONS_GHC -fno-warn-unused-imports #-} {-# LANGUAGE OverloadedStrings #-} -- | Brittany is a tool to format source code. module Haskell.Ide.Engine.Plugin.Brittany where diff --git a/src/Haskell/Ide/Engine/Plugin/Generic.hs b/src/Haskell/Ide/Engine/Plugin/Generic.hs index b5b5774e4..f613bf797 100644 --- a/src/Haskell/Ide/Engine/Plugin/Generic.hs +++ b/src/Haskell/Ide/Engine/Plugin/Generic.hs @@ -1,4 +1,3 @@ -{-# OPTIONS_GHC -fno-warn-unused-imports #-} {-# LANGUAGE CPP #-} {-# LANGUAGE DeriveGeneric #-} {-# LANGUAGE FlexibleContexts #-} diff --git a/src/Haskell/Ide/Engine/Plugin/HsImport.hs b/src/Haskell/Ide/Engine/Plugin/HsImport.hs index cee7a4d45..935f013f7 100644 --- a/src/Haskell/Ide/Engine/Plugin/HsImport.hs +++ b/src/Haskell/Ide/Engine/Plugin/HsImport.hs @@ -1,4 +1,3 @@ -{-# OPTIONS_GHC -fno-warn-unused-imports #-} {-# LANGUAGE OverloadedStrings #-} {-# LANGUAGE DeriveGeneric #-} {-# LANGUAGE DeriveAnyClass #-} diff --git a/src/Haskell/Ide/Engine/Plugin/Package.hs b/src/Haskell/Ide/Engine/Plugin/Package.hs index 5c46e1b78..199485384 100644 --- a/src/Haskell/Ide/Engine/Plugin/Package.hs +++ b/src/Haskell/Ide/Engine/Plugin/Package.hs @@ -1,4 +1,3 @@ -{-# OPTIONS_GHC -fno-warn-unused-imports #-} {-# LANGUAGE CPP #-} {-# LANGUAGE OverloadedStrings #-} {-# LANGUAGE DeriveGeneric #-} diff --git a/src/Haskell/Ide/Engine/Plugin/Pragmas.hs b/src/Haskell/Ide/Engine/Plugin/Pragmas.hs index 0e84633d3..f33c6aef2 100644 --- a/src/Haskell/Ide/Engine/Plugin/Pragmas.hs +++ b/src/Haskell/Ide/Engine/Plugin/Pragmas.hs @@ -1,4 +1,3 @@ -{-# OPTIONS_GHC -fno-warn-unused-imports #-} {-# LANGUAGE DeriveAnyClass #-} {-# LANGUAGE DeriveGeneric #-} {-# LANGUAGE OverloadedStrings #-} diff --git a/src/Haskell/Ide/Engine/Scheduler.hs b/src/Haskell/Ide/Engine/Scheduler.hs index 42f1e4520..a94787487 100644 --- a/src/Haskell/Ide/Engine/Scheduler.hs +++ b/src/Haskell/Ide/Engine/Scheduler.hs @@ -1,4 +1,3 @@ -{-# OPTIONS_GHC -fno-warn-unused-imports #-} {-# LANGUAGE FlexibleContexts #-} {-# LANGUAGE MultiParamTypeClasses #-} {-# LANGUAGE ExistentialQuantification #-} diff --git a/src/Haskell/Ide/Engine/Server.hs b/src/Haskell/Ide/Engine/Server.hs index 71e6a8dc2..9e4d51af9 100644 --- a/src/Haskell/Ide/Engine/Server.hs +++ b/src/Haskell/Ide/Engine/Server.hs @@ -1,4 +1,3 @@ -{-# OPTIONS_GHC -fno-warn-unused-imports #-} {-# LANGUAGE DuplicateRecordFields #-} {-# LANGUAGE GADTs #-} {-# LANGUAGE RankNTypes #-} diff --git a/src/Haskell/Ide/Engine/Support/HieExtras.hs b/src/Haskell/Ide/Engine/Support/HieExtras.hs index 74821a660..831f256b3 100644 --- a/src/Haskell/Ide/Engine/Support/HieExtras.hs +++ b/src/Haskell/Ide/Engine/Support/HieExtras.hs @@ -1,4 +1,3 @@ -{-# OPTIONS_GHC -fno-warn-unused-imports #-} {-# LANGUAGE CPP #-} {-# LANGUAGE DeriveGeneric #-} {-# LANGUAGE NamedFieldPuns #-} From e5d1060245814d7182842719b3a03c97284d19d5 Mon Sep 17 00:00:00 2001 From: Avi Dessauer Date: Sat, 21 Dec 2019 18:24:54 -0500 Subject: [PATCH 04/20] CPP imports + stack-8.8.1.yaml + ignore hie.yaml --- .gitignore | 1 + app/MainHie.hs | 3 ++ haskell-ide-engine.cabal | 20 +++++------ hie-plugin-api/Haskell/Ide/Engine/Ghc.hs | 6 +++- .../Haskell/Ide/Engine/PluginsIdeMonads.hs | 13 ++++--- install/shake.yaml | 2 +- src/Haskell/Ide/Engine/Completions.hs | 3 ++ src/Haskell/Ide/Engine/Plugin/ApplyRefact.hs | 5 +++ src/Haskell/Ide/Engine/Plugin/Brittany.hs | 3 +- src/Haskell/Ide/Engine/Plugin/Generic.hs | 2 ++ src/Haskell/Ide/Engine/Plugin/HsImport.hs | 3 ++ src/Haskell/Ide/Engine/Plugin/Package.hs | 5 ++- src/Haskell/Ide/Engine/Plugin/Pragmas.hs | 3 ++ src/Haskell/Ide/Engine/Scheduler.hs | 9 +++-- src/Haskell/Ide/Engine/Server.hs | 6 +++- src/Haskell/Ide/Engine/Support/HieExtras.hs | 5 ++- stack-8.6.5.yaml | 2 +- stack-8.8.1.yaml | 35 +++++++++++++++++++ stack.yaml | 2 +- 19 files changed, 103 insertions(+), 25 deletions(-) create mode 100644 stack-8.8.1.yaml diff --git a/.gitignore b/.gitignore index ac2acc891..77bf84b17 100644 --- a/.gitignore +++ b/.gitignore @@ -77,3 +77,4 @@ shake.yaml.lock # ignore hie.yaml's for testdata test/**/*.yaml +/hie.yaml diff --git a/app/MainHie.hs b/app/MainHie.hs index dd7833567..033604b82 100644 --- a/app/MainHie.hs +++ b/app/MainHie.hs @@ -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 diff --git a/haskell-ide-engine.cabal b/haskell-ide-engine.cabal index 9dddfffb1..a229137fa 100644 --- a/haskell-ide-engine.cabal +++ b/haskell-ide-engine.cabal @@ -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 @@ -101,7 +101,7 @@ library ghc-options: -Wall -Wredundant-constraints if flag(pedantic) - ghc-options: -Werror -Wwarn=unused-imports + ghc-options: -Werror default-language: Haskell2010 executable hie @@ -120,7 +120,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 @@ -141,7 +141,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 @@ -167,7 +167,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 @@ -211,7 +211,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 @@ -235,7 +235,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 @@ -255,7 +255,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 @@ -300,7 +300,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 @@ -319,7 +319,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 diff --git a/hie-plugin-api/Haskell/Ide/Engine/Ghc.hs b/hie-plugin-api/Haskell/Ide/Engine/Ghc.hs index 1ec624b5c..e40514b30 100644 --- a/hie-plugin-api/Haskell/Ide/Engine/Ghc.hs +++ b/hie-plugin-api/Haskell/Ide/Engine/Ghc.hs @@ -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 @@ -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 diff --git a/hie-plugin-api/Haskell/Ide/Engine/PluginsIdeMonads.hs b/hie-plugin-api/Haskell/Ide/Engine/PluginsIdeMonads.hs index 007f02ad1..120f1e983 100644 --- a/hie-plugin-api/Haskell/Ide/Engine/PluginsIdeMonads.hs +++ b/hie-plugin-api/Haskell/Ide/Engine/PluginsIdeMonads.hs @@ -1,3 +1,4 @@ +{-# LANGUAGE CPP #-} {-# LANGUAGE DeriveGeneric #-} {-# LANGUAGE DeriveFunctor #-} {-# LANGUAGE DeriveAnyClass #-} @@ -111,13 +112,17 @@ 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 Data.String 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 diff --git a/install/shake.yaml b/install/shake.yaml index 22867942f..8c30114fa 100644 --- a/install/shake.yaml +++ b/install/shake.yaml @@ -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: - . diff --git a/src/Haskell/Ide/Engine/Completions.hs b/src/Haskell/Ide/Engine/Completions.hs index c1234bb87..9e3ad2cf5 100644 --- a/src/Haskell/Ide/Engine/Completions.hs +++ b/src/Haskell/Ide/Engine/Completions.hs @@ -1,3 +1,4 @@ +{-# LANGUAGE CPP #-} {-# LANGUAGE DeriveGeneric #-} {-# LANGUAGE NamedFieldPuns #-} {-# LANGUAGE OverloadedStrings #-} @@ -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 ) diff --git a/src/Haskell/Ide/Engine/Plugin/ApplyRefact.hs b/src/Haskell/Ide/Engine/Plugin/ApplyRefact.hs index 884bbca38..9f3b9c647 100644 --- a/src/Haskell/Ide/Engine/Plugin/ApplyRefact.hs +++ b/src/Haskell/Ide/Engine/Plugin/ApplyRefact.hs @@ -1,3 +1,4 @@ +{-# LANGUAGE CPP #-} {-# LANGUAGE DeriveAnyClass #-} {-# LANGUAGE DeriveGeneric #-} {-# LANGUAGE DuplicateRecordFields #-} @@ -19,7 +20,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 diff --git a/src/Haskell/Ide/Engine/Plugin/Brittany.hs b/src/Haskell/Ide/Engine/Plugin/Brittany.hs index 222ddb333..eb46310e9 100644 --- a/src/Haskell/Ide/Engine/Plugin/Brittany.hs +++ b/src/Haskell/Ide/Engine/Plugin/Brittany.hs @@ -15,7 +15,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 diff --git a/src/Haskell/Ide/Engine/Plugin/Generic.hs b/src/Haskell/Ide/Engine/Plugin/Generic.hs index f613bf797..6f734ce60 100644 --- a/src/Haskell/Ide/Engine/Plugin/Generic.hs +++ b/src/Haskell/Ide/Engine/Plugin/Generic.hs @@ -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 diff --git a/src/Haskell/Ide/Engine/Plugin/HsImport.hs b/src/Haskell/Ide/Engine/Plugin/HsImport.hs index 935f013f7..e08a3b1be 100644 --- a/src/Haskell/Ide/Engine/Plugin/HsImport.hs +++ b/src/Haskell/Ide/Engine/Plugin/HsImport.hs @@ -1,3 +1,4 @@ +{-# LANGUAGE CPP #-} {-# LANGUAGE OverloadedStrings #-} {-# LANGUAGE DeriveGeneric #-} {-# LANGUAGE DeriveAnyClass #-} @@ -13,7 +14,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 diff --git a/src/Haskell/Ide/Engine/Plugin/Package.hs b/src/Haskell/Ide/Engine/Plugin/Package.hs index 199485384..481cb7224 100644 --- a/src/Haskell/Ide/Engine/Plugin/Package.hs +++ b/src/Haskell/Ide/Engine/Plugin/Package.hs @@ -22,11 +22,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 diff --git a/src/Haskell/Ide/Engine/Plugin/Pragmas.hs b/src/Haskell/Ide/Engine/Plugin/Pragmas.hs index f33c6aef2..ba1e973b5 100644 --- a/src/Haskell/Ide/Engine/Plugin/Pragmas.hs +++ b/src/Haskell/Ide/Engine/Plugin/Pragmas.hs @@ -1,3 +1,4 @@ +{-# LANGUAGE CPP #-} {-# LANGUAGE DeriveAnyClass #-} {-# LANGUAGE DeriveGeneric #-} {-# LANGUAGE OverloadedStrings #-} @@ -8,7 +9,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) diff --git a/src/Haskell/Ide/Engine/Scheduler.hs b/src/Haskell/Ide/Engine/Scheduler.hs index a94787487..1709165ff 100644 --- a/src/Haskell/Ide/Engine/Scheduler.hs +++ b/src/Haskell/Ide/Engine/Scheduler.hs @@ -1,3 +1,4 @@ +{-# LANGUAGE CPP #-} {-# LANGUAGE FlexibleContexts #-} {-# LANGUAGE MultiParamTypeClasses #-} {-# LANGUAGE ExistentialQuantification #-} @@ -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 ) diff --git a/src/Haskell/Ide/Engine/Server.hs b/src/Haskell/Ide/Engine/Server.hs index 9e4d51af9..c1250618a 100644 --- a/src/Haskell/Ide/Engine/Server.hs +++ b/src/Haskell/Ide/Engine/Server.hs @@ -1,3 +1,4 @@ +{-# LANGUAGE CPP #-} {-# LANGUAGE DuplicateRecordFields #-} {-# LANGUAGE GADTs #-} {-# LANGUAGE RankNTypes #-} @@ -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 diff --git a/src/Haskell/Ide/Engine/Support/HieExtras.hs b/src/Haskell/Ide/Engine/Support/HieExtras.hs index 831f256b3..5103608b1 100644 --- a/src/Haskell/Ide/Engine/Support/HieExtras.hs +++ b/src/Haskell/Ide/Engine/Support/HieExtras.hs @@ -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 @@ -63,7 +67,6 @@ import Packages import SrcLoc import TcEnv import Type -import Var import Module hiding (getModule) -- --------------------------------------------------------------------- diff --git a/stack-8.6.5.yaml b/stack-8.6.5.yaml index 91b637b69..4e9052e19 100644 --- a/stack-8.6.5.yaml +++ b/stack-8.6.5.yaml @@ -1,4 +1,4 @@ -resolver: lts-14.17 +resolver: lts-14.16 packages: - . - hie-plugin-api diff --git a/stack-8.8.1.yaml b/stack-8.8.1.yaml new file mode 100644 index 000000000..35e202156 --- /dev/null +++ b/stack-8.8.1.yaml @@ -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 diff --git a/stack.yaml b/stack.yaml index a891f03cf..2aac861c4 100644 --- a/stack.yaml +++ b/stack.yaml @@ -29,7 +29,7 @@ flags: pedantic: true -allow-newer: true +# allow-newer: true nix: packages: [ icu libcxx zlib ] From 756ffd653d2ee3d6deee76e927a2478898d0ca5a Mon Sep 17 00:00:00 2001 From: Avi Dessauer Date: Mon, 23 Dec 2019 16:57:31 -0500 Subject: [PATCH 05/20] Allow newer for cabal-helper --- stack.yaml | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/stack.yaml b/stack.yaml index 2aac861c4..5b2464b81 100644 --- a/stack.yaml +++ b/stack.yaml @@ -8,12 +8,9 @@ extra-deps: - ./submodules/cabal-helper - ./submodules/apply-refact -- deque-0.4.3 -- ansi-terminal-0.8.2 - 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 @@ -22,6 +19,8 @@ extra-deps: - hsimport-0.11.0 - monad-dijkstra-0.1.1.2 +allow-newer: true + flags: haskell-ide-engine: pedantic: true From 77d08fa86741f0c49edc97a614dc6dbb5e718b98 Mon Sep 17 00:00:00 2001 From: Avi Dessauer Date: Mon, 23 Dec 2019 22:18:03 -0500 Subject: [PATCH 06/20] Fix tests imports --- test/functional/FunctionalCodeActionsSpec.hs | 3 +++ test/unit/LiquidSpec.hs | 3 +++ 2 files changed, 6 insertions(+) diff --git a/test/functional/FunctionalCodeActionsSpec.hs b/test/functional/FunctionalCodeActionsSpec.hs index 251141d28..1d908c606 100644 --- a/test/functional/FunctionalCodeActionsSpec.hs +++ b/test/functional/FunctionalCodeActionsSpec.hs @@ -1,3 +1,4 @@ +{-# LANGUAGE CPP #-} {-# LANGUAGE OverloadedStrings #-} module FunctionalCodeActionsSpec where @@ -11,7 +12,9 @@ import Data.Default import qualified Data.HashMap.Strict as HM import qualified Data.Set as Set import Data.Maybe +#if __GLASGOW_HASKELL__ < 808 import Data.Monoid ((<>)) +#endif import qualified Data.Text as T import Haskell.Ide.Engine.Config import Language.Haskell.LSP.Test as Test diff --git a/test/unit/LiquidSpec.hs b/test/unit/LiquidSpec.hs index 99118fced..5f856e172 100644 --- a/test/unit/LiquidSpec.hs +++ b/test/unit/LiquidSpec.hs @@ -1,3 +1,4 @@ +{-# LANGUAGE CPP #-} {-# LANGUAGE OverloadedStrings #-} {-# LANGUAGE NamedFieldPuns #-} module LiquidSpec where @@ -7,7 +8,9 @@ import Data.List import qualified Data.ByteString.Lazy as BS import qualified Data.Text as T import qualified Data.Text.IO as T +#if __GLASGOW_HASKELL__ < 808 import Data.Monoid ((<>)) +#endif import Haskell.Ide.Engine.MonadTypes import Haskell.Ide.Engine.Plugin.Liquid import System.Directory From 4b7c4ab4a7b00998f99a3d93623fe536cc7d7757 Mon Sep 17 00:00:00 2001 From: Avi Dessauer Date: Tue, 24 Dec 2019 18:42:03 -0500 Subject: [PATCH 07/20] Stop using GHC 8.2.1 in tests --- test/testdata/wrapper/8.2.1/stack.yaml | 1 - test/testdata/wrapper/{8.2.1 => 8.8.1}/Setup.hs | 0 test/testdata/wrapper/{8.2.1 => 8.8.1}/cabal1.cabal | 0 test/testdata/wrapper/{8.2.1 => 8.8.1}/hie.yaml | 0 .../testdata/wrapper/{8.2.1 => 8.8.1}/src/Foo/Bar.hs | 0 test/testdata/wrapper/{8.2.1 => 8.8.1}/src/main.hs | 0 test/testdata/wrapper/8.8.1/stack.yaml | 1 + test/testdata/wrapper/lts-11.14/stack.yaml | 1 - .../wrapper/{lts-11.14 => lts-14.18}/Setup.hs | 0 .../wrapper/{lts-11.14 => lts-14.18}/cabal1.cabal | 0 .../wrapper/{lts-11.14 => lts-14.18}/hie.yaml | 0 .../wrapper/{lts-11.14 => lts-14.18}/src/Foo/Bar.hs | 0 .../wrapper/{lts-11.14 => lts-14.18}/src/main.hs | 0 test/testdata/wrapper/lts-14.18/stack.yaml | 1 + test/wrapper/HieWrapper.hs | 12 ++++++------ 15 files changed, 8 insertions(+), 8 deletions(-) delete mode 100644 test/testdata/wrapper/8.2.1/stack.yaml rename test/testdata/wrapper/{8.2.1 => 8.8.1}/Setup.hs (100%) rename test/testdata/wrapper/{8.2.1 => 8.8.1}/cabal1.cabal (100%) rename test/testdata/wrapper/{8.2.1 => 8.8.1}/hie.yaml (100%) rename test/testdata/wrapper/{8.2.1 => 8.8.1}/src/Foo/Bar.hs (100%) rename test/testdata/wrapper/{8.2.1 => 8.8.1}/src/main.hs (100%) create mode 100644 test/testdata/wrapper/8.8.1/stack.yaml delete mode 100644 test/testdata/wrapper/lts-11.14/stack.yaml rename test/testdata/wrapper/{lts-11.14 => lts-14.18}/Setup.hs (100%) rename test/testdata/wrapper/{lts-11.14 => lts-14.18}/cabal1.cabal (100%) rename test/testdata/wrapper/{lts-11.14 => lts-14.18}/hie.yaml (100%) rename test/testdata/wrapper/{lts-11.14 => lts-14.18}/src/Foo/Bar.hs (100%) rename test/testdata/wrapper/{lts-11.14 => lts-14.18}/src/main.hs (100%) create mode 100644 test/testdata/wrapper/lts-14.18/stack.yaml diff --git a/test/testdata/wrapper/8.2.1/stack.yaml b/test/testdata/wrapper/8.2.1/stack.yaml deleted file mode 100644 index d6a173c32..000000000 --- a/test/testdata/wrapper/8.2.1/stack.yaml +++ /dev/null @@ -1 +0,0 @@ -resolver: ghc-8.2.1 \ No newline at end of file diff --git a/test/testdata/wrapper/8.2.1/Setup.hs b/test/testdata/wrapper/8.8.1/Setup.hs similarity index 100% rename from test/testdata/wrapper/8.2.1/Setup.hs rename to test/testdata/wrapper/8.8.1/Setup.hs diff --git a/test/testdata/wrapper/8.2.1/cabal1.cabal b/test/testdata/wrapper/8.8.1/cabal1.cabal similarity index 100% rename from test/testdata/wrapper/8.2.1/cabal1.cabal rename to test/testdata/wrapper/8.8.1/cabal1.cabal diff --git a/test/testdata/wrapper/8.2.1/hie.yaml b/test/testdata/wrapper/8.8.1/hie.yaml similarity index 100% rename from test/testdata/wrapper/8.2.1/hie.yaml rename to test/testdata/wrapper/8.8.1/hie.yaml diff --git a/test/testdata/wrapper/8.2.1/src/Foo/Bar.hs b/test/testdata/wrapper/8.8.1/src/Foo/Bar.hs similarity index 100% rename from test/testdata/wrapper/8.2.1/src/Foo/Bar.hs rename to test/testdata/wrapper/8.8.1/src/Foo/Bar.hs diff --git a/test/testdata/wrapper/8.2.1/src/main.hs b/test/testdata/wrapper/8.8.1/src/main.hs similarity index 100% rename from test/testdata/wrapper/8.2.1/src/main.hs rename to test/testdata/wrapper/8.8.1/src/main.hs diff --git a/test/testdata/wrapper/8.8.1/stack.yaml b/test/testdata/wrapper/8.8.1/stack.yaml new file mode 100644 index 000000000..f32e5fadf --- /dev/null +++ b/test/testdata/wrapper/8.8.1/stack.yaml @@ -0,0 +1 @@ +rsesolver: ghc-8.8.1 diff --git a/test/testdata/wrapper/lts-11.14/stack.yaml b/test/testdata/wrapper/lts-11.14/stack.yaml deleted file mode 100644 index a6247386d..000000000 --- a/test/testdata/wrapper/lts-11.14/stack.yaml +++ /dev/null @@ -1 +0,0 @@ -resolver: lts-11.14 \ No newline at end of file diff --git a/test/testdata/wrapper/lts-11.14/Setup.hs b/test/testdata/wrapper/lts-14.18/Setup.hs similarity index 100% rename from test/testdata/wrapper/lts-11.14/Setup.hs rename to test/testdata/wrapper/lts-14.18/Setup.hs diff --git a/test/testdata/wrapper/lts-11.14/cabal1.cabal b/test/testdata/wrapper/lts-14.18/cabal1.cabal similarity index 100% rename from test/testdata/wrapper/lts-11.14/cabal1.cabal rename to test/testdata/wrapper/lts-14.18/cabal1.cabal diff --git a/test/testdata/wrapper/lts-11.14/hie.yaml b/test/testdata/wrapper/lts-14.18/hie.yaml similarity index 100% rename from test/testdata/wrapper/lts-11.14/hie.yaml rename to test/testdata/wrapper/lts-14.18/hie.yaml diff --git a/test/testdata/wrapper/lts-11.14/src/Foo/Bar.hs b/test/testdata/wrapper/lts-14.18/src/Foo/Bar.hs similarity index 100% rename from test/testdata/wrapper/lts-11.14/src/Foo/Bar.hs rename to test/testdata/wrapper/lts-14.18/src/Foo/Bar.hs diff --git a/test/testdata/wrapper/lts-11.14/src/main.hs b/test/testdata/wrapper/lts-14.18/src/main.hs similarity index 100% rename from test/testdata/wrapper/lts-11.14/src/main.hs rename to test/testdata/wrapper/lts-14.18/src/main.hs diff --git a/test/testdata/wrapper/lts-14.18/stack.yaml b/test/testdata/wrapper/lts-14.18/stack.yaml new file mode 100644 index 000000000..6a1219450 --- /dev/null +++ b/test/testdata/wrapper/lts-14.18/stack.yaml @@ -0,0 +1 @@ +resolver: lts-14.18 diff --git a/test/wrapper/HieWrapper.hs b/test/wrapper/HieWrapper.hs index ef8cb4aa5..fa3a62d8b 100644 --- a/test/wrapper/HieWrapper.hs +++ b/test/wrapper/HieWrapper.hs @@ -11,16 +11,16 @@ import System.Process main :: IO () main = hspec $ describe "version checking" $ do - it "picks up a stack.yaml with 8.2.1" $ - withCurrentDirectory "test/testdata/wrapper/8.2.1" $ do + it "picks up a stack.yaml with 8.8.1" $ + withCurrentDirectory "test/testdata/wrapper/8.8.1" $ do d <- getCurrentDirectory cradle <- liftIO (findLocalCradle (d "File.hs")) - getProjectGhcVersion cradle `shouldReturn` "8.2.1" - it "picks up a stack.yaml with 8.2.2" $ - withCurrentDirectory "test/testdata/wrapper/lts-11.14" $ do + getProjectGhcVersion cradle `shouldReturn` "8.8.1" + it "picks up a stack.yaml with 8.6.5" $ + withCurrentDirectory "test/testdata/wrapper/lts-14.18" $ do d <- getCurrentDirectory cradle <- liftIO (findLocalCradle (d "File.hs")) - getProjectGhcVersion cradle `shouldReturn` "8.2.2" + getProjectGhcVersion cradle `shouldReturn` "8.6.5" it "picks up whatever version of ghc is on this machine" $ withCurrentDirectory "test/testdata/wrapper/ghc" $ do d <- getCurrentDirectory From d1832238c0270d9463ee262efbd717e1cbdf7f83 Mon Sep 17 00:00:00 2001 From: Avi Dessauer Date: Tue, 24 Dec 2019 14:42:14 -0500 Subject: [PATCH 08/20] 8.8.1 tests --- .azure/linux-stack.yml | 2 + .azure/macos-stack.yml | 2 + .azure/windows-stack.yml | 2 + stack-8.8.1.yaml | 5 +- test/functional/FunctionalCodeActionsSpec.hs | 19 ++- test/unit/ApplyRefactPluginSpec.hs | 2 +- test/unit/PackagePluginSpec.hs | 120 +++++++++++++------ test/utils/TestUtils.hs | 11 +- 8 files changed, 117 insertions(+), 46 deletions(-) diff --git a/.azure/linux-stack.yml b/.azure/linux-stack.yml index 806ee2846..66813a87d 100644 --- a/.azure/linux-stack.yml +++ b/.azure/linux-stack.yml @@ -7,6 +7,8 @@ jobs: matrix: stack-def: YAML_FILE: stack.yaml + stack-8.8.1: + YAML_FILE: stack-8.8.1.yaml stack-8.6.5: YAML_FILE: stack-8.6.5.yaml stack-8.6.4: diff --git a/.azure/macos-stack.yml b/.azure/macos-stack.yml index e7b72a93c..28ea2c066 100644 --- a/.azure/macos-stack.yml +++ b/.azure/macos-stack.yml @@ -7,6 +7,8 @@ jobs: matrix: stack-def: YAML_FILE: stack.yaml + stack-8.8.1: + YAML_FILE: stack-8.8.1.yaml stack-8.6.5: YAML_FILE: stack-8.6.5.yaml stack-8.6.4: diff --git a/.azure/windows-stack.yml b/.azure/windows-stack.yml index 68b2c4f0f..0dda3fe00 100644 --- a/.azure/windows-stack.yml +++ b/.azure/windows-stack.yml @@ -7,6 +7,8 @@ jobs: matrix: stack-def: YAML_FILE: stack.yaml + stack-8.8.1: + YAML_FILE: stack-8.8.1.yaml stack-8.6.5: YAML_FILE: stack-8.6.5.yaml stack-8.6.4: diff --git a/stack-8.8.1.yaml b/stack-8.8.1.yaml index 35e202156..5b2464b81 100644 --- a/stack-8.8.1.yaml +++ b/stack-8.8.1.yaml @@ -6,12 +6,11 @@ packages: 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 @@ -20,6 +19,8 @@ extra-deps: - hsimport-0.11.0 - monad-dijkstra-0.1.1.2 +allow-newer: true + flags: haskell-ide-engine: pedantic: true diff --git a/test/functional/FunctionalCodeActionsSpec.hs b/test/functional/FunctionalCodeActionsSpec.hs index 1d908c606..fdc6f91a3 100644 --- a/test/functional/FunctionalCodeActionsSpec.hs +++ b/test/functional/FunctionalCodeActionsSpec.hs @@ -248,7 +248,9 @@ spec = describe "code actions" $ do executeCodeAction action contents <- getDocumentEdit . TextDocumentIdentifier =<< getDocUri "add-package-test.cabal" - liftIO $ T.lines contents `shouldSatisfy` \x -> any (\l -> "text -any" `T.isSuffixOf` (x !! l)) [15, 16] + liftIO $ + T.lines contents `shouldSatisfy` \x -> + any (\l -> "text -any" `T.isSuffixOf` l || "text : {} -any" `T.isSuffixOf` l) x it "adds to hpack package.yaml files" $ runSession hieCommand fullCaps "test/testdata/addPackageTest/hpack-exe" $ do @@ -343,6 +345,14 @@ spec = describe "code actions" $ do suggestion <- case ghcVersion of + GHC88 -> do + liftIO $ map (^. L.title) cas `shouldMatchList` + [ "Substitute hole (Int) with x ([Int])" + , "Substitute hole (Int) with foo ([Int] -> Int Valid hole fits include)" + , "Substitute hole (Int) with maxBound (forall a. Bounded a => a with maxBound @Int)" + , "Substitute hole (Int) with minBound (forall a. Bounded a => a with minBound @Int)" + ] + return "x" GHC86 -> do liftIO $ map (^. L.title) cas `shouldMatchList` [ "Substitute hole (Int) with x ([Int])" @@ -383,6 +393,13 @@ spec = describe "code actions" $ do suggestion <- case ghcVersion of + GHC88 -> do + liftIO $ map (^. L.title) cas `shouldMatchList` + [ "Substitute hole (A) with stuff (A -> A)" + , "Substitute hole (A) with x ([A])" + , "Substitute hole (A) with foo2 ([A] -> A)" + ] + return "stuff" GHC86 -> do liftIO $ map (^. L.title) cas `shouldMatchList` [ "Substitute hole (A) with stuff (A -> A)" diff --git a/test/unit/ApplyRefactPluginSpec.hs b/test/unit/ApplyRefactPluginSpec.hs index 3a7e6f004..c7ade54a3 100644 --- a/test/unit/ApplyRefactPluginSpec.hs +++ b/test/unit/ApplyRefactPluginSpec.hs @@ -152,7 +152,7 @@ applyRefactSpec = do let req = applyAllCmd filePath isExpectedError (IdeResultFail (IdeError PluginError err _)) = - "Illegal symbol '.' in type" `T.isInfixOf` err + "Illegal symbol " `T.isInfixOf` err isExpectedError _ = False r <- withCurrentDirectory "./test/testdata" $ runIGM testPlugins req r `shouldSatisfy` isExpectedError diff --git a/test/unit/PackagePluginSpec.hs b/test/unit/PackagePluginSpec.hs index 9108ff753..3de9ad03f 100644 --- a/test/unit/PackagePluginSpec.hs +++ b/test/unit/PackagePluginSpec.hs @@ -63,27 +63,48 @@ packageSpec = do uri = filePathToUri $ fp "add-package-test.cabal" args = AddParams fp (fp "AddPackage.hs") "text" act = addCmd args - textEdits = - List - [ TextEdit (Range (Position 0 0) (Position 7 27)) $ T.concat - [ "cabal-version: >=1.10\n" - , "name: add-package-test\n" - , "version: 0.1.0.0\n" - , "license: BSD3\n" - , "maintainer: luke_lau@icloud.com\n" - , "author: Luke Lau\n" - , "build-type: Simple\n" - , "extra-source-files:\n" - , " ChangeLog.md" + textEdits = case ghcVersion of + GHC88 -> + List + [ TextEdit (Range (Position 0 0) (Position 7 27)) $ T.concat + [ "cabal-version: >=1.10\n" + , "name: add-package-test\n" + , "version: 0.1.0.0\n" + , "license: BSD3\n" + , "maintainer: luke_lau@icloud.com\n" + , "author: Luke Lau\n" + , "build-type: Simple\n" + , "extra-source-files: ChangeLog.md" + ] + , TextEdit (Range (Position 10 0) (Position 13 34)) $ T.concat + [ " main-is: AddPackage.hs\n" + , " default-language: Haskell2010\n" + , " build-depends:\n" + , " base >=4.7 && <5,\n" + , " text : {} -any" + ] ] - , TextEdit (Range (Position 10 0) (Position 13 34)) $ T.concat - [ " main-is: AddPackage.hs\n" - , " default-language: Haskell2010\n" - , " build-depends:\n" - , " base >=4.7 && <5,\n" - , " text -any" + _ -> + List + [ TextEdit (Range (Position 0 0) (Position 7 27)) $ T.concat + [ "cabal-version: >=1.10\n" + , "name: add-package-test\n" + , "version: 0.1.0.0\n" + , "license: BSD3\n" + , "maintainer: luke_lau@icloud.com\n" + , "author: Luke Lau\n" + , "build-type: Simple\n" + , "extra-source-files:\n" + , " ChangeLog.md" + ] + , TextEdit (Range (Position 10 0) (Position 13 34)) $ T.concat + [ " main-is: AddPackage.hs\n" + , " default-language: Haskell2010\n" + , " build-depends:\n" + , " base >=4.7 && <5,\n" + , " text -any" + ] ] - ] res = IdeResultOk $ WorkspaceEdit (Just $ H.singleton uri textEdits) Nothing testCommand testPlugins act "package" "add" args res @@ -96,28 +117,49 @@ packageSpec = do uri = filePathToUri $ fp "add-package-test.cabal" args = AddParams fp (fp "AddPackage.hs") "text" act = addCmd args - textEdits = - List - [ TextEdit (Range (Position 0 0) (Position 7 27)) $ T.concat - [ "cabal-version: >=1.10\n" - , "name: add-package-test\n" - , "version: 0.1.0.0\n" - , "license: BSD3\n" - , "maintainer: luke_lau@icloud.com\n" - , "author: Luke Lau\n" - , "build-type: Simple\n" - , "extra-source-files:\n" - , " ChangeLog.md" + textEdits = case ghcVersion of + GHC88 -> + List + [ TextEdit (Range (Position 0 0) (Position 7 27)) $ T.concat + [ "cabal-version: >=1.10\n" + , "name: add-package-test\n" + , "version: 0.1.0.0\n" + , "license: BSD3\n" + , "maintainer: luke_lau@icloud.com\n" + , "author: Luke Lau\n" + , "build-type: Simple\n" + , "extra-source-files: ChangeLog.md" + ] + , TextEdit (Range (Position 10 0) (Position 13 34)) $ T.concat + [ " exposed-modules: AddPackage\n" + , " default-language: Haskell2010\n" + , " build-depends:\n" + , " base >=4.7 && <5,\n" + , " text : {} -any" + ] ] - , TextEdit (Range (Position 10 0) (Position 13 34)) $ T.concat - [ " exposed-modules:\n" - , " AddPackage\n" - , " default-language: Haskell2010\n" - , " build-depends:\n" - , " base >=4.7 && <5,\n" - , " text -any" + _ -> + List + [ TextEdit (Range (Position 0 0) (Position 7 27)) $ T.concat + [ "cabal-version: >=1.10\n" + , "name: add-package-test\n" + , "version: 0.1.0.0\n" + , "license: BSD3\n" + , "maintainer: luke_lau@icloud.com\n" + , "author: Luke Lau\n" + , "build-type: Simple\n" + , "extra-source-files:\n" + , " ChangeLog.md" + ] + , TextEdit (Range (Position 10 0) (Position 13 34)) $ T.concat + [ " exposed-modules:\n" + , " AddPackage\n" + , " default-language: Haskell2010\n" + , " build-depends:\n" + , " base >=4.7 && <5,\n" + , " text -any" + ] ] - ] res = IdeResultOk $ WorkspaceEdit (Just $ H.singleton uri textEdits) Nothing testCommand testPlugins act "package" "add" args res diff --git a/test/utils/TestUtils.hs b/test/utils/TestUtils.hs index b1edb382c..520106a7a 100644 --- a/test/utils/TestUtils.hs +++ b/test/utils/TestUtils.hs @@ -138,13 +138,16 @@ files = ] data GhcVersion - = GHC86 + = GHC88 + | GHC86 | GHC84 | GHCPre84 deriving (Eq,Show) ghcVersion :: GhcVersion -#if (defined(MIN_VERSION_GLASGOW_HASKELL) && (MIN_VERSION_GLASGOW_HASKELL(8,6,0,0))) +#if (defined(MIN_VERSION_GLASGOW_HASKELL) && (MIN_VERSION_GLASGOW_HASKELL(8,8,0,0))) +ghcVersion = GHC88 +#elif (defined(MIN_VERSION_GLASGOW_HASKELL) && (MIN_VERSION_GLASGOW_HASKELL(8,6,0,0))) ghcVersion = GHC86 #elif (defined(MIN_VERSION_GLASGOW_HASKELL) && (MIN_VERSION_GLASGOW_HASKELL(8,4,0,0))) ghcVersion = GHC84 @@ -154,7 +157,9 @@ ghcVersion = GHCPre84 stackYaml :: FilePath stackYaml = -#if (defined(MIN_VERSION_GLASGOW_HASKELL) && (MIN_VERSION_GLASGOW_HASKELL(8,6,5,0))) +#if (defined(MIN_VERSION_GLASGOW_HASKELL) && (MIN_VERSION_GLASGOW_HASKELL(8,8,1,0))) + "stack-8.8.1.yaml" +#elif (defined(MIN_VERSION_GLASGOW_HASKELL) && (MIN_VERSION_GLASGOW_HASKELL(8,6,5,0))) "stack-8.6.5.yaml" #elif (defined(MIN_VERSION_GLASGOW_HASKELL) && (MIN_VERSION_GLASGOW_HASKELL(8,6,4,0))) "stack-8.6.4.yaml" From 839fe9bfd6f3c885e9ae7b62ac7e43e8cc7da634 Mon Sep 17 00:00:00 2001 From: Avi Dessauer Date: Thu, 26 Dec 2019 01:46:53 -0500 Subject: [PATCH 09/20] Remove GHCPre84 --- test/functional/FunctionalCodeActionsSpec.hs | 13 ------------- test/utils/TestUtils.hs | 3 --- 2 files changed, 16 deletions(-) diff --git a/test/functional/FunctionalCodeActionsSpec.hs b/test/functional/FunctionalCodeActionsSpec.hs index fdc6f91a3..c4823a933 100644 --- a/test/functional/FunctionalCodeActionsSpec.hs +++ b/test/functional/FunctionalCodeActionsSpec.hs @@ -368,12 +368,6 @@ spec = describe "code actions" $ do , "Substitute hole (Int) with undefined (forall (a :: TYPE r). GHC.Stack.Types.HasCallStack => a)" ] return "maxBound" - GHCPre84 -> do - liftIO $ map (^. L.title) cas `shouldMatchList` - [ "Substitute hole (Int) with x ([Int])" - , "Substitute hole (Int) with foo ([Int] -> Int)" - ] - return "x" executeCodeAction $ head cas @@ -415,13 +409,6 @@ spec = describe "code actions" $ do , "Substitute hole (A) with foo2 ([A] -> A)" ] return "undefined" - GHCPre84 -> do - liftIO $ map (^. L.title) cas `shouldMatchList` - [ "Substitute hole (A) with stuff (A -> A)" - , "Substitute hole (A) with x ([A])" - , "Substitute hole (A) with foo2 ([A] -> A)" - ] - return "stuff" executeCodeAction $ head cas diff --git a/test/utils/TestUtils.hs b/test/utils/TestUtils.hs index 520106a7a..608a0355e 100644 --- a/test/utils/TestUtils.hs +++ b/test/utils/TestUtils.hs @@ -141,7 +141,6 @@ data GhcVersion = GHC88 | GHC86 | GHC84 - | GHCPre84 deriving (Eq,Show) ghcVersion :: GhcVersion @@ -151,8 +150,6 @@ ghcVersion = GHC88 ghcVersion = GHC86 #elif (defined(MIN_VERSION_GLASGOW_HASKELL) && (MIN_VERSION_GLASGOW_HASKELL(8,4,0,0))) ghcVersion = GHC84 -#else -ghcVersion = GHCPre84 #endif stackYaml :: FilePath From 180fff675f754dbb465b73453bb7956d32135eef Mon Sep 17 00:00:00 2001 From: Avi Dessauer Date: Thu, 26 Dec 2019 18:11:46 -0500 Subject: [PATCH 10/20] Handle stack 8.8.1 warning --- src/Haskell/Ide/Engine/Version.hs | 2 +- test/testdata/wrapper/8.8.1/stack.yaml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/Haskell/Ide/Engine/Version.hs b/src/Haskell/Ide/Engine/Version.hs index d81df88cf..ee672c256 100644 --- a/src/Haskell/Ide/Engine/Version.hs +++ b/src/Haskell/Ide/Engine/Version.hs @@ -45,7 +45,7 @@ getProjectGhcVersion crdl = do if isStackCradle crdl && isStackInstalled then do L.infoM "hie" "Using stack GHC version" - catch (tryCommand "stack ghc -- --numeric-version") $ \e -> do + catch (last . lines <$> tryCommand "stack ghc -- --numeric-version") $ \e -> do L.errorM "hie" $ show (e :: SomeException) L.infoM "hie" "Couldn't find stack version, falling back to plain GHC" getGhcVersion diff --git a/test/testdata/wrapper/8.8.1/stack.yaml b/test/testdata/wrapper/8.8.1/stack.yaml index f32e5fadf..115aa84ec 100644 --- a/test/testdata/wrapper/8.8.1/stack.yaml +++ b/test/testdata/wrapper/8.8.1/stack.yaml @@ -1 +1 @@ -rsesolver: ghc-8.8.1 +resolver: ghc-8.8.1 From 6ebb4753536f286b589e0aee3c83ece788dd4097 Mon Sep 17 00:00:00 2001 From: Alan Zimmerman Date: Sat, 28 Dec 2019 00:50:25 +0000 Subject: [PATCH 11/20] Get rid of allow-newer in stack files --- .gitmodules | 3 ++- cabal.project | 1 + stack-8.8.1.yaml | 11 ++++++++--- stack.yaml | 14 ++++++++------ submodules/cabal-helper | 2 +- 5 files changed, 20 insertions(+), 11 deletions(-) diff --git a/.gitmodules b/.gitmodules index 847bd7939..ce231ab7a 100644 --- a/.gitmodules +++ b/.gitmodules @@ -12,7 +12,8 @@ [submodule "submodules/cabal-helper"] path = submodules/cabal-helper - url = https://github.com/DanielG/cabal-helper.git + # url = https://github.com/DanielG/cabal-helper.git + url = https://github.com/alanz/cabal-helper.git [submodule "submodules/apply-refact"] path = submodules/apply-refact diff --git a/cabal.project b/cabal.project index 6f39ccbeb..5ba0ae2ad 100644 --- a/cabal.project +++ b/cabal.project @@ -4,6 +4,7 @@ packages: -- ./submodules/HaRe ./submodules/cabal-helper/ + ./submodules/apply-refact tests: true diff --git a/stack-8.8.1.yaml b/stack-8.8.1.yaml index 5b2464b81..2c5a7a9d7 100644 --- a/stack-8.8.1.yaml +++ b/stack-8.8.1.yaml @@ -8,18 +8,23 @@ extra-deps: - ./submodules/cabal-helper - ./submodules/apply-refact -- hie-bios-0.3.2 - bytestring-trie-0.2.5.0 +- clock-0.7.2 - constrained-dynamic-0.1.0.0 - 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 +- haskell-src-exts-1.21.1 +- hie-bios-0.3.2 +# - hoogle-5.0.17.13 +- hoogle-5.0.17.11 - hsimport-0.11.0 - monad-dijkstra-0.1.1.2 +- semigroups-0.18.5 +- temporary-1.2.1.1 -allow-newer: true +# allow-newer: true flags: haskell-ide-engine: diff --git a/stack.yaml b/stack.yaml index 5b2464b81..c556da8ce 100644 --- a/stack.yaml +++ b/stack.yaml @@ -8,18 +8,23 @@ extra-deps: - ./submodules/cabal-helper - ./submodules/apply-refact -- hie-bios-0.3.2 - bytestring-trie-0.2.5.0 +- clock-0.7.2 - constrained-dynamic-0.1.0.0 - 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 +- haskell-src-exts-1.21.1 +- hie-bios-0.3.2 +# - hoogle-5.0.17.13 +- hoogle-5.0.17.11 - hsimport-0.11.0 - monad-dijkstra-0.1.1.2 +- semigroups-0.18.5 +- temporary-1.2.1.1 -allow-newer: true +# allow-newer: true flags: haskell-ide-engine: @@ -27,9 +32,6 @@ flags: hie-plugin-api: pedantic: true - -# allow-newer: true - nix: packages: [ icu libcxx zlib ] diff --git a/submodules/cabal-helper b/submodules/cabal-helper index 5b6cefdbe..2bf10c11c 160000 --- a/submodules/cabal-helper +++ b/submodules/cabal-helper @@ -1 +1 @@ -Subproject commit 5b6cefdbe03ebc4ec6451751fbaba72cab663766 +Subproject commit 2bf10c11c46c5155973b3996f6e97344ea614517 From e8e3afdc5c38c68ac5e170259dbb69145a295360 Mon Sep 17 00:00:00 2001 From: Luke Lau Date: Sat, 28 Dec 2019 22:31:32 +0000 Subject: [PATCH 12/20] Update cabal circleCI job --- .circleci/config.yml | 11 ++++------- 1 file changed, 4 insertions(+), 7 deletions(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index b97f446ac..769c515c5 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -149,7 +149,7 @@ jobs: cabal: working_directory: ~/build docker: - - image: quay.io/haskell_works/ghc-8.6.5 + - image: haskell:8.8.1 steps: - checkout - run: @@ -161,18 +161,15 @@ jobs: - restore-cache: keys: - cabal-{{ .Environment.HIE_CACHE }}-{{ arch }}-{{ .Environment.CIRCLE_JOB }} - - run: - name: Cabal version - command: cabal --version - run: name: Update - command: cabal new-update + command: cabal update - run: name: Configure - command: cabal new-configure --enable-tests + command: cabal configure --enable-tests - run: name: Build - command: cabal new-build -j1 # need j1, else ghc-lib-parser triggers OOM + command: cabal build -j1 # need j1, else ghc-lib-parser triggers OOM no_output_timeout: 30m - save_cache: key: cabal-{{ .Environment.HIE_CACHE }}-{{ arch }}-{{ .Environment.CIRCLE_JOB }} From 43bcc5e74b4cf77018966d0ad3dd0ffac2653b0d Mon Sep 17 00:00:00 2001 From: Alan Zimmerman Date: Sun, 29 Dec 2019 20:24:06 +0000 Subject: [PATCH 13/20] Use cabal-helper from hackage --- .gitmodules | 5 ----- cabal.project | 1 - stack-8.4.2.yaml | 21 ++++++++++----------- stack-8.4.3.yaml | 19 +++++++++---------- stack-8.4.4.yaml | 18 +++++++++--------- stack-8.6.1.yaml | 14 +++++++------- stack-8.6.2.yaml | 14 +++++++------- stack-8.6.3.yaml | 16 ++++++++-------- stack-8.6.4.yaml | 13 ++++++------- stack-8.6.5.yaml | 8 ++++---- stack-8.8.1.yaml | 2 +- stack.yaml | 2 +- submodules/cabal-helper | 1 - 13 files changed, 62 insertions(+), 72 deletions(-) delete mode 160000 submodules/cabal-helper diff --git a/.gitmodules b/.gitmodules index ce231ab7a..05f22b5a4 100644 --- a/.gitmodules +++ b/.gitmodules @@ -10,11 +10,6 @@ # rm -rf path_to_submodule -[submodule "submodules/cabal-helper"] - path = submodules/cabal-helper - # url = https://github.com/DanielG/cabal-helper.git - url = https://github.com/alanz/cabal-helper.git - [submodule "submodules/apply-refact"] path = submodules/apply-refact url = https://github.com/mpickering/apply-refact.git diff --git a/cabal.project b/cabal.project index 5ba0ae2ad..675dd0b54 100644 --- a/cabal.project +++ b/cabal.project @@ -3,7 +3,6 @@ packages: ./hie-plugin-api/ -- ./submodules/HaRe - ./submodules/cabal-helper/ ./submodules/apply-refact tests: true diff --git a/stack-8.4.2.yaml b/stack-8.4.2.yaml index 3e8454872..2f0282a69 100644 --- a/stack-8.4.2.yaml +++ b/stack-8.4.2.yaml @@ -5,17 +5,19 @@ packages: extra-deps: # - ./submodules/HaRe -- ./submodules/cabal-helper -- brittany-0.12.1.0 - base-compat-0.9.3 +- brittany-0.12.1.0 - bytestring-trie-0.2.5.0 +- cabal-helper-1.0.0.0 - cabal-plan-0.5.0.0 - connection-0.3.1 # for network and network-bsd - constrained-dynamic-0.1.0.0 -- ghc-exactprint-0.6.2 # for HaRe +- extra-1.6.18 +- file-embed-0.0.11 - filepattern-0.1.1 - floskell-0.10.2 +- ghc-exactprint-0.6.2 # for HaRe - ghc-lib-parser-8.8.1 - haddock-api-2.20.0 - haddock-library-1.6.0 @@ -28,16 +30,20 @@ extra-deps: - hoogle-5.0.17.11 - hsimport-0.11.0 - hslogger-1.3.1.0 +- libyaml-0.1.1.0 - lsp-test-0.9.0.0 - monad-dijkstra-0.1.1.2 - network-3.1.1.1 # for hslogger - network-bsd-2.8.1.0 # for hslogger - pretty-show-1.8.2 - rope-utf16-splay-0.3.1.0 -- syz-0.2.0.0 - simple-sendfile-0.2.30 # for network and network-bsd - socks-0.6.1 # for network and network-bsd +- syz-0.2.0.0 - temporary-1.2.1.1 +- unix-compat-0.5.2 +- unordered-containers-0.2.10.0 +- yaml-0.11.1.2 # To make build work in windows 7 - unix-time-0.4.7 - windns-0.1.0.0 @@ -47,13 +53,6 @@ extra-deps: - wai-3.2.2.1 # for network and network-bsd -- extra-1.6.18@sha256:5f1fff126f0ae47b701fff5aa8462dc63cb44465d5a724b0afd20a3d731903af -- unix-compat-0.5.2@sha256:16763f1fae4a25abf61ac6195eb530ce838474bd04d86c7d353340aee8716bbb -- yaml-0.11.1.2@sha256:cbc4ddb233c564967aad27ee47c1cd8fd6a06b9183353e76fe66c9be7c9dfd76 -- file-embed-0.0.11@sha256:77bb3b1dc219ccd682706b1d3dfbc5bf2db5beb1af6c108ed9e0f5b4d58a5a0a,1325 -- libyaml-0.1.1.0@sha256:b3fcd8c44622c75e054c2267f3fec39a58a311748000310cbc8257a4683d3f02,2090 -- unordered-containers-0.2.10.0@sha256:5e9b095a9283d9e2f064fec73a81a6b6ea0b7fda3f219a8175785d2d2a3de204 - flags: haskell-ide-engine: pedantic: true diff --git a/stack-8.4.3.yaml b/stack-8.4.3.yaml index 93fbc062f..9d156aafc 100644 --- a/stack-8.4.3.yaml +++ b/stack-8.4.3.yaml @@ -5,17 +5,19 @@ packages: extra-deps: # - ./submodules/HaRe -- ./submodules/cabal-helper - base-compat-0.9.3 - brittany-0.12.1.0 - bytestring-trie-0.2.5.0 +- cabal-helper-1.0.0.0 - cabal-plan-0.5.0.0 - connection-0.3.1 # for network and network-bsd - constrained-dynamic-0.1.0.0 -- ghc-exactprint-0.6.2 # for HaRe +- extra-1.6.18 +- file-embed-0.0.11 - filepattern-0.1.1 - floskell-0.10.2 +- ghc-exactprint-0.6.2 # for HaRe - ghc-lib-parser-8.8.1 - haddock-api-2.20.0 - haddock-library-1.6.0 @@ -28,15 +30,19 @@ extra-deps: - hoogle-5.0.17.11 - hsimport-0.11.0 - hslogger-1.3.1.0 +- libyaml-0.1.1.0 - lsp-test-0.9.0.0 - monad-dijkstra-0.1.1.2 - network-3.1.1.1 # for hslogger - network-bsd-2.8.1.0 # for hslogger - pretty-show-1.8.2 - rope-utf16-splay-0.3.1.0 -- syz-0.2.0.0 - simple-sendfile-0.2.30 # for network and network-bsd - socks-0.6.1 # for network and network-bsd +- syz-0.2.0.0 +- unix-compat-0.5.2 +- unordered-containers-0.2.10.0 +- yaml-0.11.1.2 # To make build work in windows 7 - unix-time-0.4.7 - temporary-1.2.1.1 @@ -45,13 +51,6 @@ extra-deps: - wai-3.2.2.1 # for network and network-bsd -- extra-1.6.18@sha256:5f1fff126f0ae47b701fff5aa8462dc63cb44465d5a724b0afd20a3d731903af -- unix-compat-0.5.2@sha256:16763f1fae4a25abf61ac6195eb530ce838474bd04d86c7d353340aee8716bbb -- yaml-0.11.1.2@sha256:cbc4ddb233c564967aad27ee47c1cd8fd6a06b9183353e76fe66c9be7c9dfd76 -- file-embed-0.0.11@sha256:77bb3b1dc219ccd682706b1d3dfbc5bf2db5beb1af6c108ed9e0f5b4d58a5a0a,1325 -- libyaml-0.1.1.0@sha256:b3fcd8c44622c75e054c2267f3fec39a58a311748000310cbc8257a4683d3f02,2090 -- unordered-containers-0.2.10.0@sha256:5e9b095a9283d9e2f064fec73a81a6b6ea0b7fda3f219a8175785d2d2a3de204 - flags: haskell-ide-engine: pedantic: true diff --git a/stack-8.4.4.yaml b/stack-8.4.4.yaml index 4773450cf..5ebe02e0e 100644 --- a/stack-8.4.4.yaml +++ b/stack-8.4.4.yaml @@ -5,16 +5,18 @@ packages: extra-deps: # - ./submodules/HaRe -- ./submodules/cabal-helper - brittany-0.12.1.0 - bytestring-trie-0.2.5.0 +- cabal-helper-1.0.0.0 - cabal-plan-0.5.0.0 - connection-0.3.1 # for network and network-bsd - constrained-dynamic-0.1.0.0 -- ghc-exactprint-0.6.2 # for HaRe +- extra-1.6.18 +- file-embed-0.0.11 - filepattern-0.1.1 - floskell-0.10.2 +- ghc-exactprint-0.6.2 # for HaRe - ghc-lib-parser-8.8.1 - haddock-api-2.20.0 - haddock-library-1.6.0 @@ -27,6 +29,7 @@ extra-deps: - hoogle-5.0.17.11 - hsimport-0.11.0 - hslogger-1.3.1.0 +- libyaml-0.1.1.0 - lsp-test-0.9.0.0 - monad-dijkstra-0.1.1.2 - network-3.1.1.1 # for hslogger @@ -34,9 +37,12 @@ extra-deps: - optparse-simple-0.1.0 - pretty-show-1.9.5 - rope-utf16-splay-0.3.1.0 -- syz-0.2.0.0 - simple-sendfile-0.2.30 # for network and network-bsd - socks-0.6.1 # for network and network-bsd +- syz-0.2.0.0 +- unix-compat-0.5.2 +- unordered-containers-0.2.10.0 +- yaml-0.11.1.2 # To make build work in windows 7 - unix-time-0.4.7 - temporary-1.2.1.1 @@ -44,12 +50,6 @@ extra-deps: - warp-3.2.28 # for network and network-bsd - wai-3.2.2.1 # for network and network-bsd -- extra-1.6.18@sha256:5f1fff126f0ae47b701fff5aa8462dc63cb44465d5a724b0afd20a3d731903af -- unix-compat-0.5.2@sha256:16763f1fae4a25abf61ac6195eb530ce838474bd04d86c7d353340aee8716bbb -- yaml-0.11.1.2@sha256:cbc4ddb233c564967aad27ee47c1cd8fd6a06b9183353e76fe66c9be7c9dfd76 -- unordered-containers-0.2.10.0@sha256:5e9b095a9283d9e2f064fec73a81a6b6ea0b7fda3f219a8175785d2d2a3de204 -- file-embed-0.0.11@sha256:77bb3b1dc219ccd682706b1d3dfbc5bf2db5beb1af6c108ed9e0f5b4d58a5a0a,1325 -- libyaml-0.1.1.0@sha256:b3fcd8c44622c75e054c2267f3fec39a58a311748000310cbc8257a4683d3f02,2090 flags: haskell-ide-engine: diff --git a/stack-8.6.1.yaml b/stack-8.6.1.yaml index 8ccd97963..d34d96d15 100644 --- a/stack-8.6.1.yaml +++ b/stack-8.6.1.yaml @@ -5,22 +5,23 @@ packages: extra-deps: # - ./submodules/HaRe -- ./submodules/cabal-helper - apply-refact-0.6.0.0 - brittany-0.12.1.0 - butcher-1.3.2.3 - bytestring-trie-0.2.5.0 +- cabal-helper-1.0.0.0 - cabal-install-2.4.0.0 - cabal-plan-0.5.0.0 - constrained-dynamic-0.1.0.0 - czipwith-1.0.1.1 - data-tree-print-0.1.0.2 - deque-0.4.3 +- extra-1.6.18 - filepattern-0.1.1 - floskell-0.10.2 -- ghc-lib-parser-8.8.1 - ghc-exactprint-0.6.2 # for HaRe +- ghc-lib-parser-8.8.1 - haddock-api-2.21.0 - haskell-lsp-0.19.0.0 - haskell-lsp-types-0.19.0.0 @@ -30,6 +31,7 @@ extra-deps: - hlint-2.2.4 - hoogle-5.0.17.11 - hsimport-0.11.0 +- libyaml-0.1.1.0 - lsp-test-0.9.0.0 - monad-dijkstra-0.1.1.2 - monad-memo-0.4.1 @@ -41,14 +43,12 @@ extra-deps: - strict-list-0.1.5 - syz-0.2.0.0 - temporary-1.2.1.1 +- unix-compat-0.5.2 +- unordered-containers-0.2.10.0 +- yaml-0.11.1.2 # To make build work in windows 7 - unix-time-0.4.7 -- extra-1.6.18@sha256:5f1fff126f0ae47b701fff5aa8462dc63cb44465d5a724b0afd20a3d731903af -- unix-compat-0.5.2@sha256:16763f1fae4a25abf61ac6195eb530ce838474bd04d86c7d353340aee8716bbb -- yaml-0.11.1.2@sha256:cbc4ddb233c564967aad27ee47c1cd8fd6a06b9183353e76fe66c9be7c9dfd76 -- libyaml-0.1.1.0@sha256:b3fcd8c44622c75e054c2267f3fec39a58a311748000310cbc8257a4683d3f02,2090 -- unordered-containers-0.2.10.0@sha256:5e9b095a9283d9e2f064fec73a81a6b6ea0b7fda3f219a8175785d2d2a3de204 flags: haskell-ide-engine: diff --git a/stack-8.6.2.yaml b/stack-8.6.2.yaml index 2fd3d7bef..84bae7731 100644 --- a/stack-8.6.2.yaml +++ b/stack-8.6.2.yaml @@ -5,18 +5,19 @@ packages: extra-deps: # - ./submodules/HaRe -- ./submodules/cabal-helper - brittany-0.12.1.0 - butcher-1.3.2.3 - bytestring-trie-0.2.5.0 +- cabal-helper-1.0.0.0 - cabal-plan-0.5.0.0 - constrained-dynamic-0.1.0.0 - deque-0.4.3 +- extra-1.6.18 - filepattern-0.1.1 - floskell-0.10.2 -- ghc-lib-parser-8.8.1 - ghc-exactprint-0.6.2 # for HaRe +- ghc-lib-parser-8.8.1 - haddock-api-2.21.0 - haskell-lsp-0.19.0.0 - haskell-lsp-types-0.19.0.0 @@ -26,6 +27,7 @@ extra-deps: - hlint-2.2.4 - hoogle-5.0.17.11 - hsimport-0.11.0 +- libyaml-0.1.1.0 - lsp-test-0.9.0.0 - monad-dijkstra-0.1.1.2 - monad-memo-0.4.1 @@ -34,15 +36,13 @@ extra-deps: - strict-list-0.1.5 - syz-0.2.0.0 - temporary-1.2.1.1 +- unix-compat-0.5.2 +- unordered-containers-0.2.10.0 +- yaml-0.11.1.2 # To make build work in windows 7 - unix-time-0.4.7 #- hie-bios-0.2.1@sha256:5f98a3516ce65e0a3ffd88bf6fb416b04cc084371d0fbf0e1762780de1d652ce,3219 -- extra-1.6.18@sha256:5f1fff126f0ae47b701fff5aa8462dc63cb44465d5a724b0afd20a3d731903af -- unix-compat-0.5.2@sha256:16763f1fae4a25abf61ac6195eb530ce838474bd04d86c7d353340aee8716bbb -- yaml-0.11.1.2@sha256:cbc4ddb233c564967aad27ee47c1cd8fd6a06b9183353e76fe66c9be7c9dfd76 -- libyaml-0.1.1.0@sha256:b3fcd8c44622c75e054c2267f3fec39a58a311748000310cbc8257a4683d3f02,2090 -- unordered-containers-0.2.10.0@sha256:5e9b095a9283d9e2f064fec73a81a6b6ea0b7fda3f219a8175785d2d2a3de204 flags: haskell-ide-engine: diff --git a/stack-8.6.3.yaml b/stack-8.6.3.yaml index 588f4aa31..7c8f7bfbc 100644 --- a/stack-8.6.3.yaml +++ b/stack-8.6.3.yaml @@ -5,16 +5,17 @@ packages: extra-deps: # - ./submodules/HaRe -- ./submodules/cabal-helper - brittany-0.12.1.0 -- bytestring-trie-0.2.5.0 - butcher-1.3.2.1 +- bytestring-trie-0.2.5.0 +- cabal-helper-1.0.0.0 - cabal-plan-0.5.0.0 - constrained-dynamic-0.1.0.0 +- extra-1.6.18 - floskell-0.10.2 -- ghc-lib-parser-8.8.1 - ghc-exactprint-0.6.2 # for HaRe +- ghc-lib-parser-8.8.1 - haddock-api-2.21.0 - haskell-lsp-0.19.0.0 - haskell-lsp-types-0.19.0.0 @@ -32,14 +33,13 @@ extra-deps: - rope-utf16-splay-0.3.1.0 - syz-0.2.0.0 - temporary-1.2.1.1 +- unix-compat-0.5.2 +- unordered-containers-0.2.10.0 +- yaml-0.11.1.2 + # To make build work in windows 7 - unix-time-0.4.7 -- extra-1.6.18@sha256:5f1fff126f0ae47b701fff5aa8462dc63cb44465d5a724b0afd20a3d731903af -- unix-compat-0.5.2@sha256:16763f1fae4a25abf61ac6195eb530ce838474bd04d86c7d353340aee8716bbb -- yaml-0.11.1.2@sha256:cbc4ddb233c564967aad27ee47c1cd8fd6a06b9183353e76fe66c9be7c9dfd76 -- unordered-containers-0.2.10.0@sha256:5e9b095a9283d9e2f064fec73a81a6b6ea0b7fda3f219a8175785d2d2a3de204 - flags: haskell-ide-engine: pedantic: true diff --git a/stack-8.6.4.yaml b/stack-8.6.4.yaml index e590488b7..dfb1b45c7 100644 --- a/stack-8.6.4.yaml +++ b/stack-8.6.4.yaml @@ -5,16 +5,17 @@ packages: extra-deps: # - ./submodules/HaRe -- ./submodules/cabal-helper - brittany-0.12.1.0 - butcher-1.3.2.1 - bytestring-trie-0.2.5.0 +- cabal-helper-1.0.0.0 - cabal-plan-0.5.0.0 - constrained-dynamic-0.1.0.0 +- extra-1.6.18 - floskell-0.10.2 -- ghc-lib-parser-8.8.1 - ghc-exactprint-0.6.2 # for HaRe +- ghc-lib-parser-8.8.1 - haddock-api-2.22.0 - haskell-lsp-0.19.0.0 - haskell-lsp-types-0.19.0.0 @@ -30,14 +31,12 @@ extra-deps: - rope-utf16-splay-0.3.1.0 - syz-0.2.0.0 - temporary-1.2.1.1 +- unix-compat-0.5.2 +- unordered-containers-0.2.10.0 +- yaml-0.11.1.2 # To make build work in windows 7 - unix-time-0.4.7 -- extra-1.6.18@sha256:5f1fff126f0ae47b701fff5aa8462dc63cb44465d5a724b0afd20a3d731903af -- unix-compat-0.5.2@sha256:16763f1fae4a25abf61ac6195eb530ce838474bd04d86c7d353340aee8716bbb -- yaml-0.11.1.2@sha256:cbc4ddb233c564967aad27ee47c1cd8fd6a06b9183353e76fe66c9be7c9dfd76 -- unordered-containers-0.2.10.0@sha256:5e9b095a9283d9e2f064fec73a81a6b6ea0b7fda3f219a8175785d2d2a3de204 - flags: haskell-ide-engine: diff --git a/stack-8.6.5.yaml b/stack-8.6.5.yaml index 4e9052e19..25a003693 100644 --- a/stack-8.6.5.yaml +++ b/stack-8.6.5.yaml @@ -5,29 +5,29 @@ packages: extra-deps: # - ./submodules/HaRe -- ./submodules/cabal-helper - ansi-terminal-0.8.2 - ansi-wl-pprint-0.6.8.2 - brittany-0.12.1.0 - bytestring-trie-0.2.5.0 +- cabal-helper-1.0.0.0 - cabal-plan-0.5.0.0 +- clock-0.7.2 - constrained-dynamic-0.1.0.0 - floskell-0.10.2 -- ghc-lib-parser-8.8.1 - ghc-exactprint-0.6.2 # for HaRe +- ghc-lib-parser-8.8.1 - haddock-api-2.22.0 - haskell-lsp-0.19.0.0 - haskell-lsp-types-0.19.0.0 - hie-bios-0.3.2 - hlint-2.2.4 -- hsimport-0.11.0 - hoogle-5.0.17.11 +- hsimport-0.11.0 - lsp-test-0.9.0.0 - monad-dijkstra-0.1.1.2@rev:1 - syz-0.2.0.0 - temporary-1.2.1.1 -- clock-0.7.2 flags: haskell-ide-engine: diff --git a/stack-8.8.1.yaml b/stack-8.8.1.yaml index 2c5a7a9d7..8b5221a32 100644 --- a/stack-8.8.1.yaml +++ b/stack-8.8.1.yaml @@ -5,10 +5,10 @@ packages: extra-deps: # - ./submodules/HaRe -- ./submodules/cabal-helper - ./submodules/apply-refact - bytestring-trie-0.2.5.0 +- cabal-helper-1.0.0.0 - clock-0.7.2 - constrained-dynamic-0.1.0.0 - floskell-0.10.2 diff --git a/stack.yaml b/stack.yaml index c556da8ce..e616760b8 100644 --- a/stack.yaml +++ b/stack.yaml @@ -5,10 +5,10 @@ packages: extra-deps: # - ./submodules/HaRe -- ./submodules/cabal-helper - ./submodules/apply-refact - bytestring-trie-0.2.5.0 +- cabal-helper-1.0.0.0 - clock-0.7.2 - constrained-dynamic-0.1.0.0 - floskell-0.10.2 diff --git a/submodules/cabal-helper b/submodules/cabal-helper deleted file mode 160000 index 2bf10c11c..000000000 --- a/submodules/cabal-helper +++ /dev/null @@ -1 +0,0 @@ -Subproject commit 2bf10c11c46c5155973b3996f6e97344ea614517 From 97682e7c878df85ad489280e45168ef67fefaeb6 Mon Sep 17 00:00:00 2001 From: Alan Zimmerman Date: Mon, 30 Dec 2019 00:20:32 +0000 Subject: [PATCH 14/20] Use apply-refact-0.7.0.0 from hackage --- .gitmodules | 3 --- cabal.project | 1 - stack-8.8.1.yaml | 2 +- submodules/apply-refact | 1 - 4 files changed, 1 insertion(+), 6 deletions(-) delete mode 160000 submodules/apply-refact diff --git a/.gitmodules b/.gitmodules index 05f22b5a4..281a9120a 100644 --- a/.gitmodules +++ b/.gitmodules @@ -10,6 +10,3 @@ # rm -rf path_to_submodule -[submodule "submodules/apply-refact"] - path = submodules/apply-refact - url = https://github.com/mpickering/apply-refact.git diff --git a/cabal.project b/cabal.project index 675dd0b54..a5847f35e 100644 --- a/cabal.project +++ b/cabal.project @@ -3,7 +3,6 @@ packages: ./hie-plugin-api/ -- ./submodules/HaRe - ./submodules/apply-refact tests: true diff --git a/stack-8.8.1.yaml b/stack-8.8.1.yaml index 8b5221a32..b30cdf4d2 100644 --- a/stack-8.8.1.yaml +++ b/stack-8.8.1.yaml @@ -5,8 +5,8 @@ packages: extra-deps: # - ./submodules/HaRe -- ./submodules/apply-refact +- apply-refact-0.7.0.0 - bytestring-trie-0.2.5.0 - cabal-helper-1.0.0.0 - clock-0.7.2 diff --git a/submodules/apply-refact b/submodules/apply-refact deleted file mode 160000 index 1acf7eb86..000000000 --- a/submodules/apply-refact +++ /dev/null @@ -1 +0,0 @@ -Subproject commit 1acf7eb860be5a446828a3a2fe3644aeb5a1b55f From af0b834c77052b60f8be5b5bff6e64c95c05b29d Mon Sep 17 00:00:00 2001 From: Avi Dessauer Date: Tue, 31 Dec 2019 02:26:19 -0500 Subject: [PATCH 15/20] Update 8.8 resolvers --- stack-8.8.1.yaml | 12 ++++-------- stack.yaml | 12 ++++-------- 2 files changed, 8 insertions(+), 16 deletions(-) diff --git a/stack-8.8.1.yaml b/stack-8.8.1.yaml index 858a40595..3a4db7d9b 100644 --- a/stack-8.8.1.yaml +++ b/stack-8.8.1.yaml @@ -1,4 +1,4 @@ -resolver: nightly-2019-12-18 +resolver: nightly-2019-12-31 packages: - . - hie-plugin-api @@ -15,18 +15,14 @@ extra-deps: - fold-debounce-0.2.0.9 - haddock-api-2.23.0 - haddock-library-1.8.0 -- haskell-src-exts-1.21.1 - hie-bios-0.3.2 -# - hoogle-5.0.17.13 -- haskell-lsp-0.19.0.0 -- haskell-lsp-types-0.19.0.0 - hoogle-5.0.17.11 - hsimport-0.11.0 -- lsp-test-0.10.0.0 -- monad-dijkstra-0.1.1.2 - semigroups-0.18.5 - temporary-1.2.1.1 - +- haskell-src-exts-1.21.1 +- ilist-0.3.1.0 +- monad-dijkstra-0.1.1.2 # allow-newer: true flags: diff --git a/stack.yaml b/stack.yaml index 858a40595..3a4db7d9b 100644 --- a/stack.yaml +++ b/stack.yaml @@ -1,4 +1,4 @@ -resolver: nightly-2019-12-18 +resolver: nightly-2019-12-31 packages: - . - hie-plugin-api @@ -15,18 +15,14 @@ extra-deps: - fold-debounce-0.2.0.9 - haddock-api-2.23.0 - haddock-library-1.8.0 -- haskell-src-exts-1.21.1 - hie-bios-0.3.2 -# - hoogle-5.0.17.13 -- haskell-lsp-0.19.0.0 -- haskell-lsp-types-0.19.0.0 - hoogle-5.0.17.11 - hsimport-0.11.0 -- lsp-test-0.10.0.0 -- monad-dijkstra-0.1.1.2 - semigroups-0.18.5 - temporary-1.2.1.1 - +- haskell-src-exts-1.21.1 +- ilist-0.3.1.0 +- monad-dijkstra-0.1.1.2 # allow-newer: true flags: From 52ca3a5321116424acaf84cf118052609a1c7639 Mon Sep 17 00:00:00 2001 From: jneira Date: Fri, 10 Jan 2020 10:37:35 +0100 Subject: [PATCH 16/20] Exclude ghc-8.8.1 for windows Due to https://gitlab.haskell.org/ghc/ghc/issues/17575 --- install/src/Env.hs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/install/src/Env.hs b/install/src/Env.hs index cd8a296bd..b9b75d1cd 100644 --- a/install/src/Env.hs +++ b/install/src/Env.hs @@ -104,8 +104,8 @@ getHieVersions = do & mapMaybe (T.stripPrefix stackYamlPrefix >=> T.stripSuffix stackYamlSuffix) & map T.unpack - -- the following line excludes `8.6.3` on windows systems - & filter (\p -> not isWindowsSystem || p /= "8.6.3") + -- the following line excludes `8.6.3` and `8.8.1` on windows systems + & filter (\p -> not (isWindowsSystem && p `elem` ["8.6.3","8.8.1"])) & sort return hieVersions From 7aa384dc6ab2a2fb8c7995b2bb5c296df093f81e Mon Sep 17 00:00:00 2001 From: jneira Date: Fri, 10 Jan 2020 22:33:15 +0100 Subject: [PATCH 17/20] Not use ghc-8.8.1 for windows in azure ci --- .azure/windows-stack.yml | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/.azure/windows-stack.yml b/.azure/windows-stack.yml index 0dda3fe00..8943e3774 100644 --- a/.azure/windows-stack.yml +++ b/.azure/windows-stack.yml @@ -5,10 +5,9 @@ jobs: vmImage: windows-2019 strategy: matrix: - stack-def: - YAML_FILE: stack.yaml - stack-8.8.1: - YAML_FILE: stack-8.8.1.yaml + # We can't use stack.yaml while it uses ghc-8.8.1 + # stack-def: + # YAML_FILE: stack.yaml stack-8.6.5: YAML_FILE: stack-8.6.5.yaml stack-8.6.4: From 3c60648ed17ca8dfe57f0e37835671befb0e350c Mon Sep 17 00:00:00 2001 From: jneira Date: Fri, 17 Jan 2020 09:39:36 +0100 Subject: [PATCH 18/20] Remove duplicated allow-newer --- stack-8.8.1.yaml | 1 - stack.yaml | 1 - 2 files changed, 2 deletions(-) diff --git a/stack-8.8.1.yaml b/stack-8.8.1.yaml index 3a4db7d9b..49e7556a1 100644 --- a/stack-8.8.1.yaml +++ b/stack-8.8.1.yaml @@ -23,7 +23,6 @@ extra-deps: - haskell-src-exts-1.21.1 - ilist-0.3.1.0 - monad-dijkstra-0.1.1.2 -# allow-newer: true flags: haskell-ide-engine: diff --git a/stack.yaml b/stack.yaml index 3a4db7d9b..49e7556a1 100644 --- a/stack.yaml +++ b/stack.yaml @@ -23,7 +23,6 @@ extra-deps: - haskell-src-exts-1.21.1 - ilist-0.3.1.0 - monad-dijkstra-0.1.1.2 -# allow-newer: true flags: haskell-ide-engine: From e50676ca538b90c83927cd97a0d542093976eb58 Mon Sep 17 00:00:00 2001 From: Avi Dessauer Date: Fri, 17 Jan 2020 06:04:00 -0500 Subject: [PATCH 19/20] Bump stack nightly resolver --- stack-8.8.1.yaml | 3 +-- stack.yaml | 3 +-- 2 files changed, 2 insertions(+), 4 deletions(-) diff --git a/stack-8.8.1.yaml b/stack-8.8.1.yaml index 49e7556a1..7e6e43360 100644 --- a/stack-8.8.1.yaml +++ b/stack-8.8.1.yaml @@ -1,4 +1,4 @@ -resolver: nightly-2019-12-31 +resolver: nightly-2020-01-17 packages: - . - hie-plugin-api @@ -12,7 +12,6 @@ extra-deps: - clock-0.7.2 - constrained-dynamic-0.1.0.0 - floskell-0.10.2 -- fold-debounce-0.2.0.9 - haddock-api-2.23.0 - haddock-library-1.8.0 - hie-bios-0.3.2 diff --git a/stack.yaml b/stack.yaml index 49e7556a1..7e6e43360 100644 --- a/stack.yaml +++ b/stack.yaml @@ -1,4 +1,4 @@ -resolver: nightly-2019-12-31 +resolver: nightly-2020-01-17 packages: - . - hie-plugin-api @@ -12,7 +12,6 @@ extra-deps: - clock-0.7.2 - constrained-dynamic-0.1.0.0 - floskell-0.10.2 -- fold-debounce-0.2.0.9 - haddock-api-2.23.0 - haddock-library-1.8.0 - hie-bios-0.3.2 From fbeb428998244c006bc8a1d1d4b447e731fb6efa Mon Sep 17 00:00:00 2001 From: Avi Dessauer Date: Sat, 18 Jan 2020 18:21:12 -0500 Subject: [PATCH 20/20] Leave stack.yaml on 8.6 for windows --- stack.yaml | 28 +++++++++++++++++++--------- 1 file changed, 19 insertions(+), 9 deletions(-) diff --git a/stack.yaml b/stack.yaml index 7e6e43360..a47bc5b17 100644 --- a/stack.yaml +++ b/stack.yaml @@ -1,4 +1,4 @@ -resolver: nightly-2020-01-17 +resolver: nightly-2019-09-21 # Last GHC 8.6.5 packages: - . - hie-plugin-api @@ -6,22 +6,32 @@ packages: extra-deps: # - ./submodules/HaRe -- apply-refact-0.7.0.0 +- ansi-terminal-0.8.2 +- ansi-wl-pprint-0.6.8.2 +- brittany-0.12.1.0 - bytestring-trie-0.2.5.0 - cabal-helper-1.0.0.0 +- cabal-plan-0.5.0.0 - clock-0.7.2 - constrained-dynamic-0.1.0.0 +- deque-0.4.3 +- extra-1.6.18 - floskell-0.10.2 -- haddock-api-2.23.0 -- haddock-library-1.8.0 +- ghc-exactprint-0.6.2 # for HaRe +- ghc-lib-parser-8.8.1 +- haddock-api-2.22.0 +- haskell-lsp-0.19.0.0 +- haskell-lsp-types-0.19.0.0 - hie-bios-0.3.2 -- hoogle-5.0.17.11 +- hlint-2.2.4 - hsimport-0.11.0 -- semigroups-0.18.5 +- lsp-test-0.10.0.0 +- monad-dijkstra-0.1.1.2@rev:1 +- parser-combinators-1.2.1 +- syz-0.2.0.0 - temporary-1.2.1.1 -- haskell-src-exts-1.21.1 -- ilist-0.3.1.0 -- monad-dijkstra-0.1.1.2 +- unix-compat-0.5.2 +- yaml-0.11.1.2 flags: haskell-ide-engine: