diff --git a/.travis.yml b/.travis.yml index 146465335..4b45fed5f 100644 --- a/.travis.yml +++ b/.travis.yml @@ -22,9 +22,8 @@ install: - "./travis_long stack +RTS -N2 -RTS setup" - "./travis_long stack build --only-snapshot" - "./travis_long stack install ide-backend-server" -- "export PATH=\"${HOME}/.local/bin\":${PATH}" script: -- "./travis_long stack +RTS -N1 -RTS build" +- "STACK_YAML=stack_test.yaml ./travis_long stack +RTS -N1 -RTS build --test --no-run-tests" - "./travis_long stack +RTS -N1 -RTS build --test" - "./travis_long stack exec emacs24 -- -q --batch -L elisp -l elisp/tests/hie-tests.el -f ert-run-tests-batch-and-exit" diff --git a/Makefile b/Makefile index 4c2887fdf..44141c766 100644 --- a/Makefile +++ b/Makefile @@ -5,16 +5,19 @@ ifeq (,$(shell which $(emacs) 2> /dev/null)) endif .PHONY: test -test: test-haskell test-emacs +test: build-haskell test-haskell test-emacs .PHONY: test-emacs test-emacs: stack exec $(emacs) -- -q --batch -L elisp -l elisp/tests/hie-tests.el -f ert-run-tests-batch-and-exit .PHONY: test-haskell +build-haskell: + @STACK_YAML=stack_test.yaml stack build --test --no-run-tests test-haskell: # stack build --test --pedantic # stack complains about deprecations in ghc-mod as an extra dep +# build with -Werror enabled but run the tests without it because ide-backend picks it up stack build --test .PHONY: ghci-test diff --git a/app/MainHie.hs b/app/MainHie.hs index 1501f431e..10f676b50 100644 --- a/app/MainHie.hs +++ b/app/MainHie.hs @@ -1,3 +1,5 @@ +{-# OPTIONS_GHC -fno-warn-partial-type-signatures #-} + {-# LANGUAGE GADTs #-} {-# LANGUAGE DataKinds #-} {-# LANGUAGE TemplateHaskell #-} diff --git a/haskell-ide-engine.cabal b/haskell-ide-engine.cabal index 369770d83..97b21a8b1 100644 --- a/haskell-ide-engine.cabal +++ b/haskell-ide-engine.cabal @@ -13,6 +13,10 @@ build-type: Simple -- extra-source-files: cabal-version: >=1.10 +flag pedantic + Description: Enable -Werror + Default: False + library hs-source-dirs: src exposed-modules: Haskell.Ide.Engine.BasePlugin @@ -94,6 +98,8 @@ executable hie , transformers , vinyl ghc-options: -threaded -rtsopts -with-rtsopts=-N -Wall + if flag(pedantic) + ghc-options: -Werror default-language: Haskell2010 test-suite haskell-ide-test @@ -135,6 +141,8 @@ test-suite haskell-ide-test , unordered-containers , vinyl ghc-options: -threaded -rtsopts -with-rtsopts=-N -Wall + if flag(pedantic) + ghc-options: -Werror default-language: Haskell2010 source-repository head diff --git a/hie-apply-refact/Haskell/Ide/ApplyRefactPlugin.hs b/hie-apply-refact/Haskell/Ide/ApplyRefactPlugin.hs index cb11afe4a..4230653d5 100644 --- a/hie-apply-refact/Haskell/Ide/ApplyRefactPlugin.hs +++ b/hie-apply-refact/Haskell/Ide/ApplyRefactPlugin.hs @@ -1,3 +1,5 @@ +{-# OPTIONS_GHC -fno-warn-partial-type-signatures #-} + {-# LANGUAGE DataKinds #-} {-# LANGUAGE PartialTypeSignatures #-} {-# LANGUAGE OverloadedStrings #-} @@ -17,8 +19,6 @@ import Haskell.Ide.Engine.PluginUtils import Haskell.Ide.Engine.SemanticTypes import Language.Haskell.HLint3 as Hlint import Refact.Apply -import qualified Refact.Types as R -import Refact.Types hiding (SrcSpan) import System.Directory import System.IO.Extra @@ -108,7 +108,7 @@ showParseError (Hlint.ParseError loc message content) = unlines [show loc, messa makeDiffResult :: FilePath -> T.Text -> IO HieDiff makeDiffResult orig new = do origText <- T.readFile orig - let (HieDiff f s d) = diffText (orig,origText) ("changed",new) + let (HieDiff f _ d) = diffText (orig,origText) ("changed",new) f' <- liftIO $ makeRelativeToCurrentDirectory f -- return (HieDiff f' s' d) return (HieDiff f' "changed" d) diff --git a/hie-apply-refact/hie-apply-refact.cabal b/hie-apply-refact/hie-apply-refact.cabal index 71de9505b..1ba118945 100644 --- a/hie-apply-refact/hie-apply-refact.cabal +++ b/hie-apply-refact/hie-apply-refact.cabal @@ -11,6 +11,10 @@ build-type: Simple -- extra-source-files: cabal-version: >=1.10 +flag pedantic + Description: Enable -Werror + Default: False + library exposed-modules: Haskell.Ide.ApplyRefactPlugin build-depends: base >= 4.7 && < 5 @@ -30,4 +34,6 @@ library , transformers , vinyl >= 0.5 && < 0.6 ghc-options: -Wall + if flag(pedantic) + ghc-options: -Werror default-language: Haskell2010 diff --git a/hie-base/hie-base.cabal b/hie-base/hie-base.cabal index 8b9ad802b..531085c5c 100644 --- a/hie-base/hie-base.cabal +++ b/hie-base/hie-base.cabal @@ -11,6 +11,10 @@ build-type: Simple -- extra-source-files: cabal-version: >=1.10 +flag pedantic + Description: Enable -Werror + Default: False + library exposed-modules: Haskell.Ide.Engine.PluginTypes @@ -24,4 +28,6 @@ library , singletons , vinyl ghc-options: -Wall + if flag(pedantic) + ghc-options: -Werror default-language: Haskell2010 diff --git a/hie-docs-generator/hie-docs-generator.cabal b/hie-docs-generator/hie-docs-generator.cabal index b5b0c22fd..1d115a783 100644 --- a/hie-docs-generator/hie-docs-generator.cabal +++ b/hie-docs-generator/hie-docs-generator.cabal @@ -16,6 +16,10 @@ build-type: Simple -- extra-source-files: cabal-version: >=1.10 +flag pedantic + Description: Enable -Werror + Default: False + executable hie-docs-generator main-is: Main.hs other-modules: Options, Examples @@ -39,4 +43,7 @@ executable hie-docs-generator , pcre-heavy , text hs-source-dirs: src - default-language: Haskell2010 \ No newline at end of file + ghc-options: -Wall + if flag(pedantic) + ghc-options: -Werror + default-language: Haskell2010 diff --git a/hie-docs-generator/src/Examples.hs b/hie-docs-generator/src/Examples.hs index 5e6156566..e39790c26 100644 --- a/hie-docs-generator/src/Examples.hs +++ b/hie-docs-generator/src/Examples.hs @@ -1,16 +1,10 @@ {-# LANGUAGE OverloadedStrings #-} module Examples where -import qualified Data.Aeson as A -import qualified Data.ByteString.Lazy as BSL import qualified Data.Map as M import Data.Monoid -import qualified Data.Text as T -import Haskell.Ide.Engine.BasePlugin -import Haskell.Ide.HaRePlugin import Haskell.Ide.Engine.PluginDescriptor import Haskell.Ide.Engine.Transport.JsonStdio -import Options jsonStdioExample :: PluginId -> UntaggedCommandDescriptor -> WireRequest jsonStdioExample pluginId (CommandDesc{cmdName = name,cmdContexts = contexts,cmdAdditionalParams = cmdParams}) = diff --git a/hie-docs-generator/src/Main.hs b/hie-docs-generator/src/Main.hs index 2cccf6f9f..996b2bfb5 100644 --- a/hie-docs-generator/src/Main.hs +++ b/hie-docs-generator/src/Main.hs @@ -13,13 +13,7 @@ import qualified Data.Text as T import qualified Data.Text.Encoding as T import qualified Data.Text.IO as T import Examples -import Haskell.Ide.ApplyRefactPlugin -import Haskell.Ide.Engine.BasePlugin import Haskell.Ide.Engine.PluginDescriptor -import Haskell.Ide.ExamplePlugin2 -import Haskell.Ide.ExamplePluginAsync -import Haskell.Ide.GhcModPlugin -import Haskell.Ide.HaRePlugin import qualified Options as O import Options.Applicative import System.Directory @@ -41,11 +35,11 @@ newtype DocGenM a = generateDocs :: DocGenM () generateDocs = - do path <- pluginIndexPath + do indexPath <- pluginIndexPath index <- pluginIndex prefix <- asks O.prefix liftIO . createDirectoryIfMissing True $ prefix "plugins" - liftIO $ T.writeFile path index + liftIO $ T.writeFile indexPath index plugins <- asks O.plugins let pluginDocs = map pluginDoc $ M.toList plugins pluginDocPaths <- mapM pluginDocPath $ M.keys plugins diff --git a/hie-eg-plugin-async/Haskell/Ide/ExamplePluginAsync.hs b/hie-eg-plugin-async/Haskell/Ide/ExamplePluginAsync.hs index 210b1060c..e82274574 100644 --- a/hie-eg-plugin-async/Haskell/Ide/ExamplePluginAsync.hs +++ b/hie-eg-plugin-async/Haskell/Ide/ExamplePluginAsync.hs @@ -1,3 +1,5 @@ +{-# OPTIONS_GHC -fno-warn-partial-type-signatures #-} + {-# LANGUAGE DataKinds #-} {-# LANGUAGE OverloadedStrings #-} {-# LANGUAGE GADTs #-} @@ -8,13 +10,11 @@ import Control.Concurrent import Control.Concurrent.STM.TChan import Control.Monad.IO.Class import Control.Monad.STM -import qualified Data.Map as Map import Data.Monoid import qualified Data.Text as T import Haskell.Ide.Engine.ExtensibleState import Haskell.Ide.Engine.MonadFunctions import Haskell.Ide.Engine.PluginDescriptor -import Haskell.Ide.Engine.PluginUtils -- --------------------------------------------------------------------- @@ -64,7 +64,7 @@ instance ExtensionClass AsyncPluginState where -- | This command manages interaction with a separate process, doing stuff. longRunningCmdSync :: WorkerCmd -> CommandFunc T.Text -longRunningCmdSync cmd = CmdSync $ \_ctx req -> do +longRunningCmdSync cmd = CmdSync $ \_ctx _req -> do SubProcess cin cout _tid <- ensureProcessRunning liftIO $ atomically $ writeTChan cin cmd res <- liftIO $ atomically $ readTChan cout @@ -95,6 +95,7 @@ ensureProcessRunning = do workerProc :: TChan WorkerCmd -> TChan T.Text -> IO () workerProc cin cout = loop 1 where + loop :: Integer -> IO () loop cnt = do debugm "workerProc:top of loop" req <- liftIO $ atomically $ readTChan cin @@ -111,7 +112,7 @@ workerProc cin cout = loop 1 -- | This command manages interaction with a separate process, doing stuff. streamingCmdAsync :: WorkerCmdAsync -> CommandFunc T.Text -streamingCmdAsync cmd = CmdAsync $ \replyFunc _ctx req -> do +streamingCmdAsync cmd = CmdAsync $ \replyFunc _ctx _req -> do tid <- liftIO $ forkIO (workerProcAsync cmd replyFunc) debugm $ "streamingCmdAsync:launched worker as " ++ show tid let tidStr = T.pack (show tid ++ ":") diff --git a/hie-eg-plugin-async/hie-eg-plugin-async.cabal b/hie-eg-plugin-async/hie-eg-plugin-async.cabal index 4d529f8a2..63c0b2bd6 100644 --- a/hie-eg-plugin-async/hie-eg-plugin-async.cabal +++ b/hie-eg-plugin-async/hie-eg-plugin-async.cabal @@ -11,6 +11,10 @@ build-type: Simple -- extra-source-files: cabal-version: >=1.10 +flag pedantic + Description: Enable -Werror + Default: False + library exposed-modules: Haskell.Ide.ExamplePluginAsync build-depends: base >= 4.7 && < 5 @@ -21,4 +25,6 @@ library , text , transformers ghc-options: -Wall + if flag(pedantic) + ghc-options: -Werror default-language: Haskell2010 diff --git a/hie-example-plugin2/Haskell/Ide/ExamplePlugin2.hs b/hie-example-plugin2/Haskell/Ide/ExamplePlugin2.hs index fd13b5ae6..6825517b1 100644 --- a/hie-example-plugin2/Haskell/Ide/ExamplePlugin2.hs +++ b/hie-example-plugin2/Haskell/Ide/ExamplePlugin2.hs @@ -1,3 +1,5 @@ +{-# OPTIONS_GHC -fno-warn-partial-type-signatures #-} + {-# LANGUAGE DataKinds #-} {-# LANGUAGE PartialTypeSignatures #-} {-# LANGUAGE OverloadedStrings #-} diff --git a/hie-example-plugin2/hie-example-plugin2.cabal b/hie-example-plugin2/hie-example-plugin2.cabal index 2f625c2e0..d12dc11cf 100644 --- a/hie-example-plugin2/hie-example-plugin2.cabal +++ b/hie-example-plugin2/hie-example-plugin2.cabal @@ -11,6 +11,10 @@ build-type: Simple -- extra-source-files: cabal-version: >=1.10 +flag pedantic + Description: Enable -Werror + Default: False + library exposed-modules: Haskell.Ide.ExamplePlugin2 build-depends: base >= 4.7 && < 5 @@ -20,4 +24,6 @@ library , text , transformers ghc-options: -Wall + if flag(pedantic) + ghc-options: -Werror default-language: Haskell2010 diff --git a/hie-ghc-mod/Haskell/Ide/GhcModPlugin.hs b/hie-ghc-mod/Haskell/Ide/GhcModPlugin.hs index 4d9f24007..35b7189e1 100644 --- a/hie-ghc-mod/Haskell/Ide/GhcModPlugin.hs +++ b/hie-ghc-mod/Haskell/Ide/GhcModPlugin.hs @@ -1,3 +1,5 @@ +{-# OPTIONS_GHC -fno-warn-partial-type-signatures #-} + {-# LANGUAGE PartialTypeSignatures #-} {-# LANGUAGE DataKinds #-} {-# LANGUAGE FlexibleContexts #-} @@ -8,7 +10,6 @@ module Haskell.Ide.GhcModPlugin where import Haskell.Ide.Engine.PluginUtils -import Control.Exception import Control.Monad.IO.Class import Data.Aeson import Data.Either @@ -18,7 +19,6 @@ import qualified Data.Text.Read as T import Data.Vinyl import qualified Exception as G import Haskell.Ide.Engine.PluginDescriptor -import Haskell.Ide.Engine.PluginUtils import Haskell.Ide.Engine.SemanticTypes import qualified Language.Haskell.GhcMod as GM import qualified Language.Haskell.GhcMod.Monad as GM diff --git a/hie-ghc-mod/hie-ghc-mod.cabal b/hie-ghc-mod/hie-ghc-mod.cabal index 14c169973..58adcb402 100644 --- a/hie-ghc-mod/hie-ghc-mod.cabal +++ b/hie-ghc-mod/hie-ghc-mod.cabal @@ -11,6 +11,10 @@ build-type: Simple -- extra-source-files: cabal-version: >=1.10 +flag pedantic + Description: Enable -Werror + Default: False + library exposed-modules: Haskell.Ide.GhcModPlugin build-depends: base >= 4.7 && < 5 @@ -27,4 +31,6 @@ library , vinyl >= 0.5 && < 0.6 ghc-options: -Wall + if flag(pedantic) + ghc-options: -Werror default-language: Haskell2010 diff --git a/hie-hare/Haskell/Ide/HaRePlugin.hs b/hie-hare/Haskell/Ide/HaRePlugin.hs index 4c725dfe0..78e472c71 100644 --- a/hie-hare/Haskell/Ide/HaRePlugin.hs +++ b/hie-hare/Haskell/Ide/HaRePlugin.hs @@ -1,3 +1,5 @@ +{-# OPTIONS_GHC -fno-warn-partial-type-signatures #-} + {-# LANGUAGE PartialTypeSignatures #-} {-# LANGUAGE DataKinds #-} {-# LANGUAGE OverloadedStrings #-} @@ -143,10 +145,7 @@ makeRefactorResult changedFiles = do diffOne f1 = do let (baseFileName,ext) = splitExtension f1 f2 = (baseFileName ++ ".refactored" ++ ext) - (HieDiff f s d) <- diffFiles f1 f2 - f' <- liftIO $ makeRelativeToCurrentDirectory f - s' <- liftIO $ makeRelativeToCurrentDirectory s - return (HieDiff f s d) + diffFiles f1 f2 diffs <- mapM diffOne changedFiles return (RefactorResult diffs) diff --git a/hie-hare/hie-hare.cabal b/hie-hare/hie-hare.cabal index 7682ea2f6..c7f9219f4 100644 --- a/hie-hare/hie-hare.cabal +++ b/hie-hare/hie-hare.cabal @@ -11,6 +11,10 @@ build-type: Simple -- extra-source-files: cabal-version: >=1.10 +flag pedantic + Description: Enable -Werror + Default: False + library exposed-modules: Haskell.Ide.HaRePlugin build-depends: base >= 4.7 && < 5 @@ -27,4 +31,6 @@ library , transformers , vinyl >= 0.5 && < 0.6 ghc-options: -Wall + if flag(pedantic) + ghc-options: -Werror default-language: Haskell2010 diff --git a/hie-ide-backend/hie-ide-backend.cabal b/hie-ide-backend/hie-ide-backend.cabal index 9cc5065e7..b4c04f73f 100644 --- a/hie-ide-backend/hie-ide-backend.cabal +++ b/hie-ide-backend/hie-ide-backend.cabal @@ -11,6 +11,10 @@ build-type: Simple -- extra-source-files: cabal-version: >=1.10 +flag pedantic + Description: Enable -Werror + Default: False + library exposed-modules: Haskell.Ide.IdeBackend build-depends: aeson @@ -28,4 +32,6 @@ library , transformers , vinyl ghc-options: -Wall + if flag(pedantic) + ghc-options: -Werror default-language: Haskell2010 diff --git a/hie-plugin-api/Haskell/Ide/Engine/Monad.hs b/hie-plugin-api/Haskell/Ide/Engine/Monad.hs index 3dada7452..4ca871454 100644 --- a/hie-plugin-api/Haskell/Ide/Engine/Monad.hs +++ b/hie-plugin-api/Haskell/Ide/Engine/Monad.hs @@ -5,19 +5,12 @@ module Haskell.Ide.Engine.Monad where -import Control.Concurrent -import Control.Concurrent.MVar import Control.Exception import Control.Monad.IO.Class import Control.Monad.State.Strict -import Data.Char import Haskell.Ide.Engine.PluginDescriptor import qualified Language.Haskell.GhcMod.Monad as GM import qualified Language.Haskell.GhcMod.Types as GM -import qualified Language.Haskell.GhcMod.Utils as GM -import qualified Language.Haskell.GhcMod.Debug as GM -import System.Directory -import System.IO.Unsafe -- --------------------------------------------------------------------- runIdeM :: IdeState -> IdeM a -> IO a diff --git a/hie-plugin-api/hie-plugin-api.cabal b/hie-plugin-api/hie-plugin-api.cabal index a83761e3e..237786175 100644 --- a/hie-plugin-api/hie-plugin-api.cabal +++ b/hie-plugin-api/hie-plugin-api.cabal @@ -11,6 +11,10 @@ build-type: Simple -- extra-source-files: cabal-version: >=1.10 +flag pedantic + Description: Enable -Werror + Default: False + library exposed-modules: Haskell.Ide.Engine.ExtensibleState @@ -40,4 +44,6 @@ library , unordered-containers , vinyl >= 0.5 && < 0.6 ghc-options: -Wall + if flag(pedantic) + ghc-options: -Werror default-language: Haskell2010 diff --git a/src/Haskell/Ide/Engine/BasePlugin.hs b/src/Haskell/Ide/Engine/BasePlugin.hs index 48cd38115..db90df819 100644 --- a/src/Haskell/Ide/Engine/BasePlugin.hs +++ b/src/Haskell/Ide/Engine/BasePlugin.hs @@ -1,3 +1,5 @@ +{-# OPTIONS_GHC -fno-warn-partial-type-signatures #-} + {-# LANGUAGE DataKinds #-} {-# LANGUAGE PartialTypeSignatures #-} {-# LANGUAGE TemplateHaskell #-} diff --git a/src/Haskell/Ide/Engine/Transport/JsonHttp.hs b/src/Haskell/Ide/Engine/Transport/JsonHttp.hs index 212a25b88..55162da28 100644 --- a/src/Haskell/Ide/Engine/Transport/JsonHttp.hs +++ b/src/Haskell/Ide/Engine/Transport/JsonHttp.hs @@ -43,7 +43,8 @@ newtype Greet = Greet { _msg :: T.Text } deriving (Generic, Show) instance FromJSON Greet -instance ToJSON Greet +instance ToJSON Greet where + toJSON = genericToJSON defaultOptions newtype TaggedMap (tags :: [ParamDescType]) = TaggedMap ParamMap deriving (Monoid) diff --git a/stack_test.yaml b/stack_test.yaml new file mode 100644 index 000000000..889dea2e1 --- /dev/null +++ b/stack_test.yaml @@ -0,0 +1,42 @@ +resolver: nightly-2016-01-06 +packages: +- . +- hie-apply-refact +- hie-base +- hie-example-plugin2 +- hie-eg-plugin-async +- hie-plugin-api +- hie-ghc-mod +- hie-hare +- hie-docs-generator +- hie-ide-backend +- location: + git: https://github.com/kazu-yamamoto/ghc-mod.git + commit: b9bd4ebf77b22d2d9061d647d7799ddcc7c51228 + extra-dep: true +- location: + git: https://github.com/mpickering/apply-refact.git + commit: 402458652844c1a0f42b15123e0ceff761919415 + extra-dep: true +extra-deps: [] +flags: + haskell-ide-engine: + pedantic: true + hie-apply-refact: + pedantic: true + hie-base: + pedantic: true + hie-docs-generator: + pedantic: true + hie-eg-plugin-async: + pedantic: true + hie-example-plugin2: + pedantic: true + hie-ghc-mod: + pedantic: true + hie-hare: + pedantic: true + hie-ide-backend: + pedantic: true + hie-plugin-api: + pedantic: true diff --git a/test/ApplyRefactPluginSpec.hs b/test/ApplyRefactPluginSpec.hs index e2f302f52..8f18bba16 100644 --- a/test/ApplyRefactPluginSpec.hs +++ b/test/ApplyRefactPluginSpec.hs @@ -4,7 +4,6 @@ module ApplyRefactPluginSpec where import Control.Concurrent.STM.TChan import Control.Monad.STM import Data.Aeson -import Data.Algorithm.Diff import qualified Data.Map as Map import Haskell.Ide.Engine.Dispatcher import Haskell.Ide.Engine.Monad diff --git a/test/DispatcherSpec.hs b/test/DispatcherSpec.hs index 5a13658b6..4cdc8da6d 100644 --- a/test/DispatcherSpec.hs +++ b/test/DispatcherSpec.hs @@ -12,8 +12,6 @@ import qualified Data.HashMap.Strict as H import qualified Data.HashMap.Strict as HM import qualified Data.Map as Map import qualified Data.Text as T -import qualified Data.Vinyl.Functor as Vinyl -import GHC.TypeLits import Haskell.Ide.Engine.Dispatcher import Haskell.Ide.Engine.Monad import Haskell.Ide.Engine.MonadFunctions diff --git a/test/ExamplePluginAsyncSpec.hs b/test/ExamplePluginAsyncSpec.hs index 3bafdea85..6c86c67fc 100644 --- a/test/ExamplePluginAsyncSpec.hs +++ b/test/ExamplePluginAsyncSpec.hs @@ -1,24 +1,16 @@ {-# LANGUAGE OverloadedStrings #-} module ExamplePluginAsyncSpec where -import Control.Concurrent import Control.Concurrent.STM.TChan -import Control.Monad.IO.Class import Control.Monad.STM import Data.Aeson import qualified Data.HashMap.Strict as H -import qualified Data.Text as T -import qualified Data.HashMap.Strict as HM import qualified Data.Map as Map -import Data.Typeable import Haskell.Ide.Engine.Dispatcher -import Haskell.Ide.Engine.ExtensibleState import Haskell.Ide.Engine.Monad import Haskell.Ide.Engine.MonadFunctions import Haskell.Ide.Engine.PluginDescriptor import Haskell.Ide.Engine.Types -import Haskell.Ide.Engine.Utils -import Haskell.Ide.Engine.PluginDescriptor import Haskell.Ide.ExamplePluginAsync import Test.Hspec @@ -35,7 +27,6 @@ examplePluginAsyncSpec = do describe "stores and retrieves in the state" $ do it "stores the first one" $ do chan <- atomically newTChan - chSync <- atomically newTChan let req1 = IdeRequest "cmd1" (Map.fromList []) cr1 = CReq "test" 1 req1 chan let req2 = IdeRequest "cmd2" (Map.fromList []) diff --git a/test/ExtensibleStateSpec.hs b/test/ExtensibleStateSpec.hs index ac2aa1f2c..3b54f3d7e 100644 --- a/test/ExtensibleStateSpec.hs +++ b/test/ExtensibleStateSpec.hs @@ -1,14 +1,11 @@ {-# LANGUAGE OverloadedStrings #-} module ExtensibleStateSpec where -import Control.Concurrent import Control.Concurrent.STM.TChan -import Control.Monad.IO.Class import Control.Monad.STM import Data.Aeson import qualified Data.HashMap.Strict as H import qualified Data.Text as T -import qualified Data.HashMap.Strict as HM import qualified Data.Map as Map import Data.Typeable import Haskell.Ide.Engine.Dispatcher @@ -17,8 +14,6 @@ import Haskell.Ide.Engine.Monad import Haskell.Ide.Engine.MonadFunctions import Haskell.Ide.Engine.PluginDescriptor import Haskell.Ide.Engine.Types -import Haskell.Ide.Engine.Utils -import Haskell.Ide.Engine.PluginDescriptor import Test.Hspec @@ -55,7 +50,7 @@ testPlugins :: TChan () -> Plugins testPlugins chSync = Map.fromList [("test",testDescriptor chSync)] testDescriptor :: TChan () -> UntaggedPluginDescriptor -testDescriptor chSync = PluginDescriptor +testDescriptor _chSync = PluginDescriptor { pdUIShortName = "testDescriptor" , pdUIOverview = "PluginDescriptor for testing Dispatcher" diff --git a/test/HaRePluginSpec.hs b/test/HaRePluginSpec.hs index 6c71db268..41467ea1c 100644 --- a/test/HaRePluginSpec.hs +++ b/test/HaRePluginSpec.hs @@ -4,7 +4,6 @@ module HaRePluginSpec where import Control.Concurrent.STM.TChan import Control.Monad.STM import Data.Aeson -import Data.Algorithm.Diff import qualified Data.Map as Map import Haskell.Ide.Engine.Dispatcher import Haskell.Ide.Engine.Monad diff --git a/test/IdeBackendPluginSpec.hs b/test/IdeBackendPluginSpec.hs index 8b58a73d4..db903bdb3 100644 --- a/test/IdeBackendPluginSpec.hs +++ b/test/IdeBackendPluginSpec.hs @@ -2,7 +2,6 @@ module IdeBackendPluginSpec where import Control.Concurrent.STM.TChan -import Control.Exception import Control.Monad.STM import Data.Aeson import qualified Data.HashMap.Strict as H