From 60c0df26d1f7544f84fdc9ead0234c367d11d83d Mon Sep 17 00:00:00 2001 From: Alan Zimmerman Date: Sun, 20 Oct 2019 21:53:27 +0100 Subject: [PATCH] Update haskell-lsp to 0.17 Together with haskell-lsp-types and lsp-test This now supports LSP spec 3.15 --- haskell-ide-engine.cabal | 12 +++--- hie-plugin-api/hie-plugin-api.cabal | 2 +- stack-8.2.2.yaml | 6 +-- stack-8.4.2.yaml | 6 +-- stack-8.4.3.yaml | 6 +-- stack-8.4.4.yaml | 6 +-- stack-8.6.1.yaml | 6 +-- stack-8.6.2.yaml | 6 +-- stack-8.6.3.yaml | 6 +-- stack-8.6.4.yaml | 6 +-- stack-8.6.5.yaml | 6 +-- stack.yaml | 6 +-- test/functional/CommandSpec.hs | 2 +- test/functional/DeferredSpec.hs | 12 +++--- test/functional/FormatSpec.hs | 14 +++---- test/functional/FunctionalCodeActionsSpec.hs | 4 +- test/functional/ProgressSpec.hs | 41 ++++++++++++-------- test/unit/JsonSpec.hs | 6 ++- 18 files changed, 83 insertions(+), 70 deletions(-) diff --git a/haskell-ide-engine.cabal b/haskell-ide-engine.cabal index 4e746183b..7bbd6b3c4 100644 --- a/haskell-ide-engine.cabal +++ b/haskell-ide-engine.cabal @@ -71,8 +71,8 @@ library , gitrev >= 1.1 , haddock-api , haddock-library - , haskell-lsp == 0.16.* - , haskell-lsp-types == 0.16.* + , haskell-lsp == 0.17.* + , haskell-lsp-types == 0.17.* , haskell-src-exts , hie-plugin-api , hoogle >= 5.0.13 @@ -199,7 +199,7 @@ test-suite unit-test , free , ghc , haskell-ide-engine - , haskell-lsp-types == 0.16.* + , haskell-lsp-types == 0.17.* , hie-test-utils , hie-plugin-api , hoogle > 5.0.11 @@ -285,10 +285,10 @@ test-suite func-test , data-default , directory , filepath - , lsp-test >= 0.6.0.0 + , lsp-test >= 0.8.0.0 , haskell-ide-engine - , haskell-lsp-types == 0.16.* - , haskell-lsp == 0.16.* + , haskell-lsp-types == 0.17.* + , haskell-lsp == 0.17.* , hie-test-utils , hie-plugin-api , hspec diff --git a/hie-plugin-api/hie-plugin-api.cabal b/hie-plugin-api/hie-plugin-api.cabal index de48b7ea9..1c4ed1ac1 100644 --- a/hie-plugin-api/hie-plugin-api.cabal +++ b/hie-plugin-api/hie-plugin-api.cabal @@ -45,7 +45,7 @@ library , ghc , ghc-mod-core >= 5.9.0.0 , ghc-project-types >= 5.9.0.0 - , haskell-lsp == 0.16.* + , haskell-lsp == 0.17.* , hslogger , monad-control , mtl diff --git a/stack-8.2.2.yaml b/stack-8.2.2.yaml index 6f716ede3..a36b72f07 100644 --- a/stack-8.2.2.yaml +++ b/stack-8.2.2.yaml @@ -20,14 +20,14 @@ extra-deps: - ghc-exactprint-0.5.8.2 - haddock-api-2.18.1 - haddock-library-1.4.4 -- haskell-lsp-0.16.0.0 -- haskell-lsp-types-0.16.0.0 +- haskell-lsp-0.17.0.0 +- haskell-lsp-types-0.17.0.0 - haskell-src-exts-1.21.0 - haskell-src-exts-util-0.2.5 - hlint-2.1.17 # last hlint supporting GHC 8.2 - hoogle-5.0.17.9 - hsimport-0.8.8 -- lsp-test-0.7.0.0 +- lsp-test-0.8.0.0 - monad-dijkstra-0.1.1.2 - pretty-show-1.8.2 - rope-utf16-splay-0.3.1.0 diff --git a/stack-8.4.2.yaml b/stack-8.4.2.yaml index 85c616ffb..f1aa155a8 100644 --- a/stack-8.4.2.yaml +++ b/stack-8.4.2.yaml @@ -19,14 +19,14 @@ extra-deps: - ghc-lib-parser-8.8.0.20190723 - haddock-api-2.20.0 - haddock-library-1.6.0 -- haskell-lsp-0.16.0.0 -- haskell-lsp-types-0.16.0.0 +- haskell-lsp-0.17.0.0 +- haskell-lsp-types-0.17.0.0 - haskell-src-exts-1.21.0 - haskell-src-exts-util-0.2.5 - hlint-2.2.2 - hoogle-5.0.17.9 - hsimport-0.10.0 -- lsp-test-0.7.0.0 +- lsp-test-0.8.0.0 - monad-dijkstra-0.1.1.2 - pretty-show-1.8.2 - rope-utf16-splay-0.3.1.0 diff --git a/stack-8.4.3.yaml b/stack-8.4.3.yaml index f129f64af..959961048 100644 --- a/stack-8.4.3.yaml +++ b/stack-8.4.3.yaml @@ -19,14 +19,14 @@ extra-deps: - ghc-lib-parser-8.8.0.20190723 - haddock-api-2.20.0 - haddock-library-1.6.0 -- haskell-lsp-0.16.0.0 -- haskell-lsp-types-0.16.0.0 +- haskell-lsp-0.17.0.0 +- haskell-lsp-types-0.17.0.0 - haskell-src-exts-1.21.0 - haskell-src-exts-util-0.2.5 - hlint-2.2.2 - hoogle-5.0.17.9 - hsimport-0.10.0 -- lsp-test-0.7.0.0 +- lsp-test-0.8.0.0 - monad-dijkstra-0.1.1.2 - pretty-show-1.8.2 - rope-utf16-splay-0.3.1.0 diff --git a/stack-8.4.4.yaml b/stack-8.4.4.yaml index 4e8256b38..99b74e812 100644 --- a/stack-8.4.4.yaml +++ b/stack-8.4.4.yaml @@ -18,14 +18,14 @@ extra-deps: - ghc-lib-parser-8.8.0.20190723 - haddock-api-2.20.0 - haddock-library-1.6.0 -- haskell-lsp-0.16.0.0 -- haskell-lsp-types-0.16.0.0 +- haskell-lsp-0.17.0.0 +- haskell-lsp-types-0.17.0.0 - haskell-src-exts-1.21.0 - haskell-src-exts-util-0.2.5 - hlint-2.2.2 - hoogle-5.0.17.9 - hsimport-0.10.0 -- lsp-test-0.7.0.0 +- lsp-test-0.8.0.0 - monad-dijkstra-0.1.1.2 - optparse-simple-0.1.0 - pretty-show-1.9.5 diff --git a/stack-8.6.1.yaml b/stack-8.6.1.yaml index df3b9ee45..404751b15 100644 --- a/stack-8.6.1.yaml +++ b/stack-8.6.1.yaml @@ -21,14 +21,14 @@ extra-deps: - floskell-0.10.0 - ghc-lib-parser-8.8.0.20190723 - haddock-api-2.21.0 -- haskell-lsp-0.16.0.0 -- haskell-lsp-types-0.16.0.0 +- haskell-lsp-0.17.0.0 +- haskell-lsp-types-0.17.0.0 - haskell-src-exts-1.21.0 - haskell-src-exts-util-0.2.5 - hlint-2.2.2 - hoogle-5.0.17.9 - hsimport-0.10.0 -- lsp-test-0.7.0.0 +- lsp-test-0.8.0.0 - monad-dijkstra-0.1.1.2 - monad-memo-0.4.1 - monoid-subclasses-0.4.6.1 diff --git a/stack-8.6.2.yaml b/stack-8.6.2.yaml index 35e3f9604..a8be3341d 100644 --- a/stack-8.6.2.yaml +++ b/stack-8.6.2.yaml @@ -17,14 +17,14 @@ extra-deps: - floskell-0.10.0 - ghc-lib-parser-8.8.0.20190723 - haddock-api-2.21.0 -- haskell-lsp-0.16.0.0 -- haskell-lsp-types-0.16.0.0 +- haskell-lsp-0.17.0.0 +- haskell-lsp-types-0.17.0.0 - haskell-src-exts-1.21.0 - haskell-src-exts-util-0.2.5 - hlint-2.2.2 - hoogle-5.0.17.9 - hsimport-0.10.0 -- lsp-test-0.7.0.0 +- lsp-test-0.8.0.0 - monad-dijkstra-0.1.1.2 - monad-memo-0.4.1 - multistate-0.8.0.1 diff --git a/stack-8.6.3.yaml b/stack-8.6.3.yaml index 9c29fdc7a..f5fe0c1d1 100644 --- a/stack-8.6.3.yaml +++ b/stack-8.6.3.yaml @@ -17,14 +17,14 @@ extra-deps: - floskell-0.10.0 - ghc-lib-parser-8.8.0.20190723 - haddock-api-2.21.0 -- haskell-lsp-0.16.0.0 -- haskell-lsp-types-0.16.0.0 +- haskell-lsp-0.17.0.0 +- haskell-lsp-types-0.17.0.0 - haskell-src-exts-1.21.0 - haskell-src-exts-util-0.2.5 - hlint-2.2.2 - hoogle-5.0.17.9 - hsimport-0.10.0 -- lsp-test-0.7.0.0 +- lsp-test-0.8.0.0 - monad-dijkstra-0.1.1.2 - monad-memo-0.4.1 - multistate-0.8.0.1 diff --git a/stack-8.6.4.yaml b/stack-8.6.4.yaml index d8f27c8d4..7b702e00f 100644 --- a/stack-8.6.4.yaml +++ b/stack-8.6.4.yaml @@ -17,13 +17,13 @@ extra-deps: - floskell-0.10.0 - ghc-lib-parser-8.8.0.20190723 - haddock-api-2.22.0 -- haskell-lsp-0.16.0.0 -- haskell-lsp-types-0.16.0.0 +- haskell-lsp-0.17.0.0 +- haskell-lsp-types-0.17.0.0 - haskell-src-exts-1.21.0 - hlint-2.2.2 - hoogle-5.0.17.9 - hsimport-0.10.0 -- lsp-test-0.7.0.0 +- lsp-test-0.8.0.0 - monad-dijkstra-0.1.1.2@rev:1 - monad-memo-0.4.1 - multistate-0.8.0.1 diff --git a/stack-8.6.5.yaml b/stack-8.6.5.yaml index 46ecdfb1a..51c065f4b 100644 --- a/stack-8.6.5.yaml +++ b/stack-8.6.5.yaml @@ -17,13 +17,13 @@ extra-deps: - floskell-0.10.0 - ghc-lib-parser-8.8.0.20190723 - haddock-api-2.22.0 -- haskell-lsp-0.16.0.0 -- haskell-lsp-types-0.16.0.0 +- haskell-lsp-0.17.0.0 +- haskell-lsp-types-0.17.0.0 - haskell-src-exts-1.21.0 - hlint-2.2.2 - hsimport-0.10.0 - hoogle-5.0.17.9 -- lsp-test-0.7.0.0 +- lsp-test-0.8.0.0 - monad-dijkstra-0.1.1.2@rev:1 - monad-memo-0.4.1 - multistate-0.8.0.1 diff --git a/stack.yaml b/stack.yaml index b8f0ae23d..465c436b1 100644 --- a/stack.yaml +++ b/stack.yaml @@ -18,11 +18,11 @@ extra-deps: - floskell-0.10.1 - ghc-lib-parser-8.8.0.20190723 - haddock-api-2.22.0 -- haskell-lsp-0.16.0.0 -- haskell-lsp-types-0.16.0.0 +- haskell-lsp-0.17.0.0 +- haskell-lsp-types-0.17.0.0 - hlint-2.2.2 - hsimport-0.10.0 -- lsp-test-0.7.0.0 +- lsp-test-0.8.0.0 - monad-dijkstra-0.1.1.2@rev:1 - syz-0.2.0.0 - temporary-1.2.1.1 diff --git a/test/functional/CommandSpec.hs b/test/functional/CommandSpec.hs index c85fa0654..fbeb6c8d0 100644 --- a/test/functional/CommandSpec.hs +++ b/test/functional/CommandSpec.hs @@ -24,7 +24,7 @@ spec = describe "commands" $ do it "get de-prefixed" $ runSession hieCommand fullCaps "test/testdata/" $ do ResponseMessage _ _ _ (Just err) <- request WorkspaceExecuteCommand - (ExecuteCommandParams "1234:package:add" (Just (List []))) :: Session ExecuteCommandResponse + (ExecuteCommandParams "1234:package:add" (Just (List [])) Nothing) :: Session ExecuteCommandResponse let ResponseError _ msg _ = err -- We expect an error message about the dud arguments, but should pickup "add" and "package" liftIO $ msg `shouldSatisfy` T.isInfixOf "while parsing args for add in plugin package" diff --git a/test/functional/DeferredSpec.hs b/test/functional/DeferredSpec.hs index 060f2afe5..1676f74cf 100644 --- a/test/functional/DeferredSpec.hs +++ b/test/functional/DeferredSpec.hs @@ -25,18 +25,18 @@ spec = do it "do not affect hover requests" $ runSession hieCommand fullCaps "test/testdata" $ do doc <- openDoc "FuncTest.hs" "haskell" - id1 <- sendRequest TextDocumentHover (TextDocumentPositionParams doc (Position 4 2)) + id1 <- sendRequest TextDocumentHover (TextDocumentPositionParams doc (Position 4 2) Nothing) skipMany anyNotification hoverRsp <- message :: Session HoverResponse liftIO $ hoverRsp ^? result . _Just . _Just . contents `shouldBe` Nothing liftIO $ hoverRsp ^. LSP.id `shouldBe` responseId id1 - id2 <- sendRequest TextDocumentDocumentSymbol (DocumentSymbolParams doc) + id2 <- sendRequest TextDocumentDocumentSymbol (DocumentSymbolParams doc Nothing) symbolsRsp <- skipManyTill anyNotification message :: Session DocumentSymbolsResponse liftIO $ symbolsRsp ^. LSP.id `shouldBe` responseId id2 - id3 <- sendRequest TextDocumentHover (TextDocumentPositionParams doc (Position 4 2)) + id3 <- sendRequest TextDocumentHover (TextDocumentPositionParams doc (Position 4 2) Nothing) hoverRsp2 <- skipManyTill anyNotification message :: Session HoverResponse liftIO $ hoverRsp2 ^. LSP.id `shouldBe` responseId id3 @@ -44,8 +44,8 @@ spec = do liftIO $ contents2 `shouldNotSatisfy` null -- Now that we have cache the following request should be instant - let highlightParams = TextDocumentPositionParams doc (Position 7 0) - highlightRsp <- request TextDocumentDocumentHighlight highlightParams :: Session DocumentHighlightsResponse + let highlightParams = TextDocumentPositionParams doc (Position 7 0) Nothing + highlightRsp <- request TextDocumentDocumentHighlight highlightParams let (Just (List locations)) = highlightRsp ^. result liftIO $ locations `shouldBe` [ DocumentHighlight { _range = Range @@ -126,7 +126,7 @@ spec = do let args' = H.fromList [("pos", toJSON (Position 7 0)), ("file", toJSON testUri)] args = List [Object args'] - executeRsp <- request WorkspaceExecuteCommand (ExecuteCommandParams "hare:demote" (Just args)) + executeRsp <- request WorkspaceExecuteCommand (ExecuteCommandParams "hare:demote" (Just args) Nothing) liftIO $ executeRsp ^. result `shouldBe` Just (Object H.empty) editReq <- message :: Session ApplyWorkspaceEditRequest diff --git a/test/functional/FormatSpec.hs b/test/functional/FormatSpec.hs index fbbe919cb..2b8524617 100644 --- a/test/functional/FormatSpec.hs +++ b/test/functional/FormatSpec.hs @@ -30,7 +30,7 @@ spec = do doc <- openDoc "Format.hs" "haskell" formatRange doc (FormattingOptions 5 True) (Range (Position 4 0) (Position 7 19)) documentContents doc >>= liftIO . (`shouldBe` formattedRangeTabSize5) - + describe "formatting provider" $ do let formatLspConfig provider = object [ "languageServerHaskell" .= object ["formattingProvider" .= (provider :: Value)] ] @@ -42,7 +42,7 @@ spec = do formatDoc doc (FormattingOptions 2 True) documentContents doc >>= liftIO . (`shouldBe` orig) - + formatRange doc (FormattingOptions 2 True) (Range (Position 1 0) (Position 3 10)) documentContents doc >>= liftIO . (`shouldBe` orig) @@ -60,18 +60,18 @@ spec = do sendNotification WorkspaceDidChangeConfiguration (DidChangeConfigurationParams (formatLspConfig "brittany")) formatDoc doc (FormattingOptions 2 True) documentContents doc >>= liftIO . (`shouldBe` formattedBrittanyPostFloskell) - + describe "brittany" $ do it "formats a document with LF endings" $ runSession hieCommand fullCaps "test/testdata" $ do doc <- openDoc "BrittanyLF.hs" "haskell" - let opts = DocumentFormattingParams doc (FormattingOptions 4 True) + let opts = DocumentFormattingParams doc (FormattingOptions 4 True) Nothing ResponseMessage _ _ (Just edits) _ <- request TextDocumentFormatting opts liftIO $ edits `shouldBe` [TextEdit (Range (Position 0 0) (Position 3 0)) "foo :: Int -> String -> IO ()\nfoo x y = do\n print x\n return 42\n"] it "formats a document with CRLF endings" $ runSession hieCommand fullCaps "test/testdata" $ do doc <- openDoc "BrittanyCRLF.hs" "haskell" - let opts = DocumentFormattingParams doc (FormattingOptions 4 True) + let opts = DocumentFormattingParams doc (FormattingOptions 4 True) Nothing ResponseMessage _ _ (Just edits) _ <- request TextDocumentFormatting opts liftIO $ edits `shouldBe` [TextEdit (Range (Position 0 0) (Position 3 0)) "foo :: Int -> String -> IO ()\nfoo x y = do\n print x\n return 42\n"] @@ -79,7 +79,7 @@ spec = do it "formats a range with LF endings" $ runSession hieCommand fullCaps "test/testdata" $ do doc <- openDoc "BrittanyLF.hs" "haskell" let range = Range (Position 1 0) (Position 2 22) - opts = DocumentRangeFormattingParams doc range (FormattingOptions 4 True) + opts = DocumentRangeFormattingParams doc range (FormattingOptions 4 True) Nothing ResponseMessage _ _ (Just edits) _ <- request TextDocumentRangeFormatting opts liftIO $ edits `shouldBe` [TextEdit (Range (Position 1 0) (Position 3 0)) "foo x y = do\n print x\n return 42\n"] @@ -87,7 +87,7 @@ spec = do it "formats a range with CRLF endings" $ runSession hieCommand fullCaps "test/testdata" $ do doc <- openDoc "BrittanyCRLF.hs" "haskell" let range = Range (Position 1 0) (Position 2 22) - opts = DocumentRangeFormattingParams doc range (FormattingOptions 4 True) + opts = DocumentRangeFormattingParams doc range (FormattingOptions 4 True) Nothing ResponseMessage _ _ (Just edits) _ <- request TextDocumentRangeFormatting opts liftIO $ edits `shouldBe` [TextEdit (Range (Position 1 0) (Position 3 0)) "foo x y = do\n print x\n return 42\n"] diff --git a/test/functional/FunctionalCodeActionsSpec.hs b/test/functional/FunctionalCodeActionsSpec.hs index 60c6c993a..59b2c7db6 100644 --- a/test/functional/FunctionalCodeActionsSpec.hs +++ b/test/functional/FunctionalCodeActionsSpec.hs @@ -503,9 +503,9 @@ spec = describe "code actions" $ do doc <- openDoc "CodeActionOnly.hs" "haskell" _ <- count 2 waitForDiagnostics -- need to wait for both hlint and ghcmod diags <- getCurrentDiagnostics doc - let params = CodeActionParams doc (Range (Position 2 10) (Position 4 0)) caContext + let params = CodeActionParams doc (Range (Position 2 10) (Position 4 0)) caContext Nothing caContext = CodeActionContext (List diags) (Just (List [CodeActionRefactorInline])) - ResponseMessage _ _ (Just (List res)) _ <- request TextDocumentCodeAction params :: Session CodeActionResponse + ResponseMessage _ _ (Just (List res)) _ <- request TextDocumentCodeAction params let cas = map fromAction res kinds = map (^. L.kind) cas liftIO $ do diff --git a/test/functional/ProgressSpec.hs b/test/functional/ProgressSpec.hs index e4b88d343..f0fdfc702 100644 --- a/test/functional/ProgressSpec.hs +++ b/test/functional/ProgressSpec.hs @@ -16,7 +16,7 @@ import Test.Hspec import TestUtils spec :: Spec -spec = describe "window/progress" $ do +spec = describe "window/workDoneProgress" $ do it "sends indefinite progress notifications" $ -- Testing that ghc-mod sends progress notifications runSession hieCommand progressCaps "test/testdata" $ do @@ -27,13 +27,17 @@ spec = describe "window/progress" $ do -- Initial hlint notifications _ <- publishDiagnosticsNotification - startNotification <- message :: Session ProgressStartNotification + createRequest <- message :: Session WorkDoneProgressCreateRequest liftIO $ do - startNotification ^. L.params . L.title `shouldBe` "Typechecking ApplyRefact2.hs" - startNotification ^. L.params . L.id `shouldBe` "0" + createRequest ^. L.params `shouldBe` WorkDoneProgressCreateParams (ProgressNumericToken 0) - doneNotification <- skipManyTill loggingNotification (message :: Session ProgressDoneNotification) - liftIO $ doneNotification ^. L.params . L.id `shouldBe` "0" + startNotification <- message :: Session WorkDoneProgressBeginNotification + liftIO $ do + startNotification ^. L.params . L.value . L.title `shouldBe` "Typechecking ApplyRefact2.hs" + startNotification ^. L.params . L.token `shouldBe` (ProgressNumericToken 0) + + doneNotification <- skipManyTill loggingNotification (message :: Session WorkDoneProgressEndNotification) + liftIO $ doneNotification ^. L.params . L.token `shouldBe` (ProgressNumericToken 0) -- the ghc-mod diagnostics _ <- skipManyTill loggingNotification publishDiagnosticsNotification @@ -44,13 +48,17 @@ spec = describe "window/progress" $ do -- hlint notifications _ <- skipManyTill loggingNotification publishDiagnosticsNotification - startNotification' <- skipManyTill loggingNotification (message :: Session ProgressStartNotification) + createRequest' <- skipManyTill loggingNotification (message :: Session WorkDoneProgressCreateRequest) + liftIO $ do + createRequest' ^. L.params `shouldBe` WorkDoneProgressCreateParams (ProgressNumericToken 1) + + startNotification' <- message :: Session WorkDoneProgressBeginNotification liftIO $ do - startNotification' ^. L.params . L.title `shouldBe` "Typechecking ApplyRefact2.hs" - startNotification' ^. L.params . L.id `shouldBe` "1" + startNotification' ^. L.params . L.value . L.title `shouldBe` "Typechecking ApplyRefact2.hs" + startNotification' ^. L.params . L.token `shouldBe` (ProgressNumericToken 1) - doneNotification' <- skipManyTill loggingNotification (message :: Session ProgressDoneNotification) - liftIO $ doneNotification' ^. L.params . L.id `shouldBe` "1" + doneNotification' <- skipManyTill loggingNotification (message :: Session WorkDoneProgressEndNotification) + liftIO $ doneNotification' ^. L.params . L.token `shouldBe` (ProgressNumericToken 1) -- the ghc-mod diagnostics const () <$> skipManyTill loggingNotification publishDiagnosticsNotification @@ -65,8 +73,9 @@ spec = describe "window/progress" $ do -- Initial hlint notifications _ <- skipManyTill loggingNotification publishDiagnosticsNotification - _ <- message :: Session ProgressStartNotification - _ <- message :: Session ProgressDoneNotification + _ <- message :: Session WorkDoneProgressCreateRequest + _ <- message :: Session WorkDoneProgressBeginNotification + _ <- message :: Session WorkDoneProgressEndNotification -- the ghc-mod diagnostics _ <- skipManyTill loggingNotification publishDiagnosticsNotification @@ -81,11 +90,11 @@ spec = describe "window/progress" $ do -- hlint notifications _ <- skipManyTill loggingNotification publishDiagnosticsNotification - let startPred (NotProgressStart m) = - m ^. L.params . L.title == "Running Liquid Haskell on Evens.hs" + let startPred (NotWorkDoneProgressBegin m) = + m ^. L.params . L.value . L.title == "Running Liquid Haskell on Evens.hs" startPred _ = False - let donePred (NotProgressDone _) = True + let donePred (NotWorkDoneProgressEnd _) = True donePred _ = False _ <- skipManyTill anyMessage $ between (satisfy startPred) (satisfy donePred) $ diff --git a/test/unit/JsonSpec.hs b/test/unit/JsonSpec.hs index 2fe2e4f12..43d001c67 100644 --- a/test/unit/JsonSpec.hs +++ b/test/unit/JsonSpec.hs @@ -12,6 +12,7 @@ import Haskell.Ide.Engine.Plugin.GhcMod import Haskell.Ide.Engine.Plugin.HaRe import Haskell.Ide.Engine.Support.HieExtras import Haskell.Ide.Engine.Config +import Language.Haskell.LSP.Types import Data.Aeson import Test.Hspec @@ -87,7 +88,10 @@ instance Arbitrary TextDocumentIdentifier where arbitrary = TextDocumentIdentifier <$> arbitrary instance Arbitrary TextDocumentPositionParams where - arbitrary = TextDocumentPositionParams <$> arbitrary <*> arbitrary + arbitrary = TextDocumentPositionParams <$> arbitrary <*> arbitrary <*> arbitrary + +instance Arbitrary ProgressToken where + arbitrary = oneof [ProgressTextToken <$> arbitrary, ProgressNumericToken <$> arbitrary] instance Arbitrary IdeErrorCode where arbitrary = arbitraryBoundedEnum