haskell-tools-demo 0.9.0.0 → 1.0.0.0
raw patch · 5 files changed
+20/−22 lines, 5 filesdep ~basedep ~ghcdep ~haskell-tools-ast
Dependency ranges changed: base, ghc, haskell-tools-ast, haskell-tools-backend-ghc, haskell-tools-builtin-refactorings, haskell-tools-prettyprint, haskell-tools-refactor, websockets
Files
- haskell-tools-demo.cabal +12/−12
- src/Language/Haskell/Tools/ASTDebug.hs +1/−1
- src/Language/Haskell/Tools/ASTDebug/Instances.hs +2/−2
- src/Language/Haskell/Tools/Demo.hs +1/−2
- test/Main.hs +4/−5
haskell-tools-demo.cabal view
@@ -1,5 +1,5 @@ name: haskell-tools-demo -version: 0.9.0.0 +version: 1.0.0.0 synopsis: A web-based demo for Haskell-tools Refactor. description: Allows websocket clients to connect and performs refactorings on demand. The clients maintain a continous connection with the server, sending changes in the source files. When a refactor request is received, it performs the changes and sends the modified source files to the client. homepage: https://github.com/haskell-tools/haskell-tools @@ -16,7 +16,7 @@ exposed-modules: Language.Haskell.Tools.Demo other-modules: Language.Haskell.Tools.ASTDebug , Language.Haskell.Tools.ASTDebug.Instances - build-depends: base >= 4.9 && < 4.10 + build-depends: base >= 4.10 && < 4.11 , mtl >= 2.2 && < 2.3 , transformers >= 0.5 && < 0.6 , directory >= 1.2 && < 1.4 @@ -26,24 +26,24 @@ , http-types >= 0.9 && < 0.10 , warp >= 3.2 && < 3.3 , wai >= 3.2 && < 3.3 - , websockets >= 0.10 && < 0.12 + , websockets >= 0.12 && < 0.13 , wai-websockets >= 3.0 && < 3.1 , references >= 0.3 && < 0.4 - , ghc >= 8.0.2 && < 8.1 + , ghc >= 8.2 && < 8.3 , ghc-paths >= 0.1 && < 0.2 , filepath >= 1.4 && < 1.5 - , haskell-tools-ast >= 0.9 && < 0.10 - , haskell-tools-backend-ghc >= 0.9 && < 0.10 - , haskell-tools-prettyprint >= 0.9 && < 0.10 - , haskell-tools-builtin-refactorings >= 0.9 && < 0.10 - , haskell-tools-refactor >= 0.9 && < 0.10 + , haskell-tools-ast >= 1.0 && < 1.1 + , haskell-tools-backend-ghc >= 1.0 && < 1.1 + , haskell-tools-prettyprint >= 1.0 && < 1.1 + , haskell-tools-builtin-refactorings >= 1.0 && < 1.1 + , haskell-tools-refactor >= 1.0 && < 1.1 default-language: Haskell2010 executable ht-demo main-is: Main.hs hs-source-dirs: exe ghc-options: -with-rtsopts=-M1500m - build-depends: base >= 4.9 && < 4.10 + build-depends: base >= 4.10 && < 4.11 , haskell-tools-demo default-language: Haskell2010 @@ -52,7 +52,7 @@ ghc-options: -with-rtsopts=-M2g hs-source-dirs: test main-is: Main.hs - build-depends: base >= 4.9 && < 4.10 + build-depends: base >= 4.10 && < 4.11 , HUnit >= 1.5 && < 1.7 , tasty >= 0.11 && < 0.12 , tasty-hunit >= 0.9 && < 0.10 @@ -60,7 +60,7 @@ , filepath >= 1.4 && < 2.0 , bytestring >= 0.10 && < 0.11 , network >= 2.6 && < 2.7 - , websockets >= 0.10 && < 0.11 + , websockets >= 0.12 && < 0.13 , aeson >= 1.0 && < 1.3 , haskell-tools-demo default-language: Haskell2010
src/Language/Haskell/Tools/ASTDebug.hs view
@@ -20,7 +20,7 @@ import Data.Foldable import Data.List as List import Data.Maybe -import Data.Sequence as Seq +import Data.Sequence as Seq (Seq, (><), empty, fromList) import GHC.Generics import Outputable import SrcLoc
src/Language/Haskell/Tools/ASTDebug/Instances.hs view
@@ -1,8 +1,6 @@ {-# LANGUAGE FlexibleContexts , FlexibleInstances , MultiParamTypeClasses - , StandaloneDeriving - , DeriveGeneric , UndecidableInstances , TypeFamilies #-} @@ -77,6 +75,7 @@ instance (Domain dom, SourceInfo st) => ASTDebug UConDecl dom st instance (Domain dom, SourceInfo st) => ASTDebug UFieldDecl dom st instance (Domain dom, SourceInfo st) => ASTDebug UDeriving dom st +instance (Domain dom, SourceInfo st) => ASTDebug UDeriveStrategy dom st instance (Domain dom, SourceInfo st) => ASTDebug UInstanceRule dom st instance (Domain dom, SourceInfo st) => ASTDebug UInstanceHead dom st instance (Domain dom, SourceInfo st) => ASTDebug UTypeEqn dom st @@ -133,6 +132,7 @@ instance (Domain dom, SourceInfo st) => ASTDebug UMatchLhs dom st instance (Domain dom, SourceInfo st) => ASTDebug UInlinePragma dom st instance (Domain dom, SourceInfo st) => ASTDebug USpecializePragma dom st +instance (Domain dom, SourceInfo st) => ASTDebug UUnboxedSumPlaceHolder dom st -- ULiteral instance (Domain dom, SourceInfo st) => ASTDebug ULiteral dom st
src/Language/Haskell/Tools/Demo.hs view
@@ -1,7 +1,6 @@ {-# LANGUAGE OverloadedStrings , DeriveGeneric , TypeApplications - , TupleSections , ScopedTypeVariables , LambdaCase , TemplateHaskell @@ -92,7 +91,7 @@ serverLoop :: Int -> Session -> MVar RefactorSessionState -> Connection -> IO () serverLoop sessId ghcSess state conn = - do Text msg <- receiveDataMessage conn + do Text msg _ <- receiveDataMessage conn respondTo wd sessId ghcSess state (sendTextData conn) msg currState <- readMVar state if currState ^. isDisconnecting
test/Main.hs view
@@ -1,11 +1,10 @@-{-# LANGUAGE StandaloneDeriving, LambdaCase #-} +{-# LANGUAGE StandaloneDeriving #-} module Main where import Control.Concurrent (killThread, forkIO) import Control.Monad (Monad(..), mapM) import Data.Aeson import qualified Data.ByteString.Lazy.Char8 as BS (unpack) -import qualified Data.List as List ((++), map) import Data.Maybe (Maybe(..)) import Network.WebSockets import System.IO (IO(..)) @@ -23,8 +22,8 @@ allTests :: TestTree allTests - = localOption (mkTimeout ({- 10s -} 1000 * 1000 * 10)) - $ testGroup "daemon-tests" + = localOption (mkTimeout ({- 30s -} 1000 * 1000 * 30)) + $ testGroup "demo-tests" [ testGroup "simple-tests" $ map makeDemoTest simpleTests , testGroup "loading-tests" $ map makeDemoTest loadingTests , testGroup "refactor-tests" $ map makeDemoTest refactorTests @@ -114,7 +113,7 @@ receiveAllResponses :: Connection -> IO [ResponseMsg] receiveAllResponses conn = do - Text mess <- receiveDataMessage conn + Text mess _ <- receiveDataMessage conn let decoded = decode mess case decoded of Just Disconnected -> return [] Just other -> (other :) <$> receiveAllResponses conn