Skip to content
This repository was archived by the owner on Oct 7, 2020. It is now read-only.
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 6 additions & 6 deletions haskell-ide-engine.cabal
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion hie-plugin-api/hie-plugin-api.cabal
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
6 changes: 3 additions & 3 deletions stack-8.2.2.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
6 changes: 3 additions & 3 deletions stack-8.4.2.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
6 changes: 3 additions & 3 deletions stack-8.4.3.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
6 changes: 3 additions & 3 deletions stack-8.4.4.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
6 changes: 3 additions & 3 deletions stack-8.6.1.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
6 changes: 3 additions & 3 deletions stack-8.6.2.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
6 changes: 3 additions & 3 deletions stack-8.6.3.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
6 changes: 3 additions & 3 deletions stack-8.6.4.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
6 changes: 3 additions & 3 deletions stack-8.6.5.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
6 changes: 3 additions & 3 deletions stack.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion test/functional/CommandSpec.hs
Original file line number Diff line number Diff line change
Expand Up @@ -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"
12 changes: 6 additions & 6 deletions test/functional/DeferredSpec.hs
Original file line number Diff line number Diff line change
Expand Up @@ -25,27 +25,27 @@ 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

let contents2 = hoverRsp2 ^? result . _Just . _Just . contents
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
Expand Down Expand Up @@ -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
Expand Down
14 changes: 7 additions & 7 deletions test/functional/FormatSpec.hs
Original file line number Diff line number Diff line change
Expand Up @@ -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)] ]
Expand All @@ -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)

Expand All @@ -60,34 +60,34 @@ 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"]

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"]

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"]
Expand Down
4 changes: 2 additions & 2 deletions test/functional/FunctionalCodeActionsSpec.hs
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
Loading