Skip to content
This repository was archived by the owner on Oct 7, 2020. It is now read-only.

Commit 3ec201f

Browse files
authored
Merge pull request #1418 from alanz/haskell-lsp-0.17
Update haskell-lsp to 0.17
2 parents 414bbee + 60c0df2 commit 3ec201f

18 files changed

+83
-70
lines changed

haskell-ide-engine.cabal

+6-6
Original file line numberDiff line numberDiff line change
@@ -71,8 +71,8 @@ library
7171
, gitrev >= 1.1
7272
, haddock-api
7373
, haddock-library
74-
, haskell-lsp == 0.16.*
75-
, haskell-lsp-types == 0.16.*
74+
, haskell-lsp == 0.17.*
75+
, haskell-lsp-types == 0.17.*
7676
, haskell-src-exts
7777
, hie-plugin-api
7878
, hoogle >= 5.0.13
@@ -199,7 +199,7 @@ test-suite unit-test
199199
, free
200200
, ghc
201201
, haskell-ide-engine
202-
, haskell-lsp-types == 0.16.*
202+
, haskell-lsp-types == 0.17.*
203203
, hie-test-utils
204204
, hie-plugin-api
205205
, hoogle > 5.0.11
@@ -285,10 +285,10 @@ test-suite func-test
285285
, data-default
286286
, directory
287287
, filepath
288-
, lsp-test >= 0.6.0.0
288+
, lsp-test >= 0.8.0.0
289289
, haskell-ide-engine
290-
, haskell-lsp-types == 0.16.*
291-
, haskell-lsp == 0.16.*
290+
, haskell-lsp-types == 0.17.*
291+
, haskell-lsp == 0.17.*
292292
, hie-test-utils
293293
, hie-plugin-api
294294
, hspec

hie-plugin-api/hie-plugin-api.cabal

+1-1
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ library
4545
, ghc
4646
, ghc-mod-core >= 5.9.0.0
4747
, ghc-project-types >= 5.9.0.0
48-
, haskell-lsp == 0.16.*
48+
, haskell-lsp == 0.17.*
4949
, hslogger
5050
, monad-control
5151
, mtl

stack-8.2.2.yaml

+3-3
Original file line numberDiff line numberDiff line change
@@ -20,14 +20,14 @@ extra-deps:
2020
- ghc-exactprint-0.5.8.2
2121
- haddock-api-2.18.1
2222
- haddock-library-1.4.4
23-
- haskell-lsp-0.16.0.0
24-
- haskell-lsp-types-0.16.0.0
23+
- haskell-lsp-0.17.0.0
24+
- haskell-lsp-types-0.17.0.0
2525
- haskell-src-exts-1.21.0
2626
- haskell-src-exts-util-0.2.5
2727
- hlint-2.1.17 # last hlint supporting GHC 8.2
2828
- hoogle-5.0.17.9
2929
- hsimport-0.8.8
30-
- lsp-test-0.7.0.0
30+
- lsp-test-0.8.0.0
3131
- monad-dijkstra-0.1.1.2
3232
- pretty-show-1.8.2
3333
- rope-utf16-splay-0.3.1.0

stack-8.4.2.yaml

+3-3
Original file line numberDiff line numberDiff line change
@@ -19,14 +19,14 @@ extra-deps:
1919
- ghc-lib-parser-8.8.0.20190723
2020
- haddock-api-2.20.0
2121
- haddock-library-1.6.0
22-
- haskell-lsp-0.16.0.0
23-
- haskell-lsp-types-0.16.0.0
22+
- haskell-lsp-0.17.0.0
23+
- haskell-lsp-types-0.17.0.0
2424
- haskell-src-exts-1.21.0
2525
- haskell-src-exts-util-0.2.5
2626
- hlint-2.2.2
2727
- hoogle-5.0.17.9
2828
- hsimport-0.10.0
29-
- lsp-test-0.7.0.0
29+
- lsp-test-0.8.0.0
3030
- monad-dijkstra-0.1.1.2
3131
- pretty-show-1.8.2
3232
- rope-utf16-splay-0.3.1.0

stack-8.4.3.yaml

+3-3
Original file line numberDiff line numberDiff line change
@@ -19,14 +19,14 @@ extra-deps:
1919
- ghc-lib-parser-8.8.0.20190723
2020
- haddock-api-2.20.0
2121
- haddock-library-1.6.0
22-
- haskell-lsp-0.16.0.0
23-
- haskell-lsp-types-0.16.0.0
22+
- haskell-lsp-0.17.0.0
23+
- haskell-lsp-types-0.17.0.0
2424
- haskell-src-exts-1.21.0
2525
- haskell-src-exts-util-0.2.5
2626
- hlint-2.2.2
2727
- hoogle-5.0.17.9
2828
- hsimport-0.10.0
29-
- lsp-test-0.7.0.0
29+
- lsp-test-0.8.0.0
3030
- monad-dijkstra-0.1.1.2
3131
- pretty-show-1.8.2
3232
- rope-utf16-splay-0.3.1.0

stack-8.4.4.yaml

+3-3
Original file line numberDiff line numberDiff line change
@@ -18,14 +18,14 @@ extra-deps:
1818
- ghc-lib-parser-8.8.0.20190723
1919
- haddock-api-2.20.0
2020
- haddock-library-1.6.0
21-
- haskell-lsp-0.16.0.0
22-
- haskell-lsp-types-0.16.0.0
21+
- haskell-lsp-0.17.0.0
22+
- haskell-lsp-types-0.17.0.0
2323
- haskell-src-exts-1.21.0
2424
- haskell-src-exts-util-0.2.5
2525
- hlint-2.2.2
2626
- hoogle-5.0.17.9
2727
- hsimport-0.10.0
28-
- lsp-test-0.7.0.0
28+
- lsp-test-0.8.0.0
2929
- monad-dijkstra-0.1.1.2
3030
- optparse-simple-0.1.0
3131
- pretty-show-1.9.5

stack-8.6.1.yaml

+3-3
Original file line numberDiff line numberDiff line change
@@ -21,14 +21,14 @@ extra-deps:
2121
- floskell-0.10.0
2222
- ghc-lib-parser-8.8.0.20190723
2323
- haddock-api-2.21.0
24-
- haskell-lsp-0.16.0.0
25-
- haskell-lsp-types-0.16.0.0
24+
- haskell-lsp-0.17.0.0
25+
- haskell-lsp-types-0.17.0.0
2626
- haskell-src-exts-1.21.0
2727
- haskell-src-exts-util-0.2.5
2828
- hlint-2.2.2
2929
- hoogle-5.0.17.9
3030
- hsimport-0.10.0
31-
- lsp-test-0.7.0.0
31+
- lsp-test-0.8.0.0
3232
- monad-dijkstra-0.1.1.2
3333
- monad-memo-0.4.1
3434
- monoid-subclasses-0.4.6.1

stack-8.6.2.yaml

+3-3
Original file line numberDiff line numberDiff line change
@@ -17,14 +17,14 @@ extra-deps:
1717
- floskell-0.10.0
1818
- ghc-lib-parser-8.8.0.20190723
1919
- haddock-api-2.21.0
20-
- haskell-lsp-0.16.0.0
21-
- haskell-lsp-types-0.16.0.0
20+
- haskell-lsp-0.17.0.0
21+
- haskell-lsp-types-0.17.0.0
2222
- haskell-src-exts-1.21.0
2323
- haskell-src-exts-util-0.2.5
2424
- hlint-2.2.2
2525
- hoogle-5.0.17.9
2626
- hsimport-0.10.0
27-
- lsp-test-0.7.0.0
27+
- lsp-test-0.8.0.0
2828
- monad-dijkstra-0.1.1.2
2929
- monad-memo-0.4.1
3030
- multistate-0.8.0.1

stack-8.6.3.yaml

+3-3
Original file line numberDiff line numberDiff line change
@@ -17,14 +17,14 @@ extra-deps:
1717
- floskell-0.10.0
1818
- ghc-lib-parser-8.8.0.20190723
1919
- haddock-api-2.21.0
20-
- haskell-lsp-0.16.0.0
21-
- haskell-lsp-types-0.16.0.0
20+
- haskell-lsp-0.17.0.0
21+
- haskell-lsp-types-0.17.0.0
2222
- haskell-src-exts-1.21.0
2323
- haskell-src-exts-util-0.2.5
2424
- hlint-2.2.2
2525
- hoogle-5.0.17.9
2626
- hsimport-0.10.0
27-
- lsp-test-0.7.0.0
27+
- lsp-test-0.8.0.0
2828
- monad-dijkstra-0.1.1.2
2929
- monad-memo-0.4.1
3030
- multistate-0.8.0.1

stack-8.6.4.yaml

+3-3
Original file line numberDiff line numberDiff line change
@@ -17,13 +17,13 @@ extra-deps:
1717
- floskell-0.10.0
1818
- ghc-lib-parser-8.8.0.20190723
1919
- haddock-api-2.22.0
20-
- haskell-lsp-0.16.0.0
21-
- haskell-lsp-types-0.16.0.0
20+
- haskell-lsp-0.17.0.0
21+
- haskell-lsp-types-0.17.0.0
2222
- haskell-src-exts-1.21.0
2323
- hlint-2.2.2
2424
- hoogle-5.0.17.9
2525
- hsimport-0.10.0
26-
- lsp-test-0.7.0.0
26+
- lsp-test-0.8.0.0
2727
- monad-dijkstra-0.1.1.2@rev:1
2828
- monad-memo-0.4.1
2929
- multistate-0.8.0.1

stack-8.6.5.yaml

+3-3
Original file line numberDiff line numberDiff line change
@@ -17,13 +17,13 @@ extra-deps:
1717
- floskell-0.10.0
1818
- ghc-lib-parser-8.8.0.20190723
1919
- haddock-api-2.22.0
20-
- haskell-lsp-0.16.0.0
21-
- haskell-lsp-types-0.16.0.0
20+
- haskell-lsp-0.17.0.0
21+
- haskell-lsp-types-0.17.0.0
2222
- haskell-src-exts-1.21.0
2323
- hlint-2.2.2
2424
- hsimport-0.10.0
2525
- hoogle-5.0.17.9
26-
- lsp-test-0.7.0.0
26+
- lsp-test-0.8.0.0
2727
- monad-dijkstra-0.1.1.2@rev:1
2828
- monad-memo-0.4.1
2929
- multistate-0.8.0.1

stack.yaml

+3-3
Original file line numberDiff line numberDiff line change
@@ -18,11 +18,11 @@ extra-deps:
1818
- floskell-0.10.1
1919
- ghc-lib-parser-8.8.0.20190723
2020
- haddock-api-2.22.0
21-
- haskell-lsp-0.16.0.0
22-
- haskell-lsp-types-0.16.0.0
21+
- haskell-lsp-0.17.0.0
22+
- haskell-lsp-types-0.17.0.0
2323
- hlint-2.2.2
2424
- hsimport-0.10.0
25-
- lsp-test-0.7.0.0
25+
- lsp-test-0.8.0.0
2626
- monad-dijkstra-0.1.1.2@rev:1
2727
- syz-0.2.0.0
2828
- temporary-1.2.1.1

test/functional/CommandSpec.hs

+1-1
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ spec = describe "commands" $ do
2424
it "get de-prefixed" $ runSession hieCommand fullCaps "test/testdata/" $ do
2525
ResponseMessage _ _ _ (Just err) <- request
2626
WorkspaceExecuteCommand
27-
(ExecuteCommandParams "1234:package:add" (Just (List []))) :: Session ExecuteCommandResponse
27+
(ExecuteCommandParams "1234:package:add" (Just (List [])) Nothing) :: Session ExecuteCommandResponse
2828
let ResponseError _ msg _ = err
2929
-- We expect an error message about the dud arguments, but should pickup "add" and "package"
3030
liftIO $ msg `shouldSatisfy` T.isInfixOf "while parsing args for add in plugin package"

test/functional/DeferredSpec.hs

+6-6
Original file line numberDiff line numberDiff line change
@@ -25,27 +25,27 @@ spec = do
2525
it "do not affect hover requests" $ runSession hieCommand fullCaps "test/testdata" $ do
2626
doc <- openDoc "FuncTest.hs" "haskell"
2727

28-
id1 <- sendRequest TextDocumentHover (TextDocumentPositionParams doc (Position 4 2))
28+
id1 <- sendRequest TextDocumentHover (TextDocumentPositionParams doc (Position 4 2) Nothing)
2929

3030
skipMany anyNotification
3131
hoverRsp <- message :: Session HoverResponse
3232
liftIO $ hoverRsp ^? result . _Just . _Just . contents `shouldBe` Nothing
3333
liftIO $ hoverRsp ^. LSP.id `shouldBe` responseId id1
3434

35-
id2 <- sendRequest TextDocumentDocumentSymbol (DocumentSymbolParams doc)
35+
id2 <- sendRequest TextDocumentDocumentSymbol (DocumentSymbolParams doc Nothing)
3636
symbolsRsp <- skipManyTill anyNotification message :: Session DocumentSymbolsResponse
3737
liftIO $ symbolsRsp ^. LSP.id `shouldBe` responseId id2
3838

39-
id3 <- sendRequest TextDocumentHover (TextDocumentPositionParams doc (Position 4 2))
39+
id3 <- sendRequest TextDocumentHover (TextDocumentPositionParams doc (Position 4 2) Nothing)
4040
hoverRsp2 <- skipManyTill anyNotification message :: Session HoverResponse
4141
liftIO $ hoverRsp2 ^. LSP.id `shouldBe` responseId id3
4242

4343
let contents2 = hoverRsp2 ^? result . _Just . _Just . contents
4444
liftIO $ contents2 `shouldNotSatisfy` null
4545

4646
-- Now that we have cache the following request should be instant
47-
let highlightParams = TextDocumentPositionParams doc (Position 7 0)
48-
highlightRsp <- request TextDocumentDocumentHighlight highlightParams :: Session DocumentHighlightsResponse
47+
let highlightParams = TextDocumentPositionParams doc (Position 7 0) Nothing
48+
highlightRsp <- request TextDocumentDocumentHighlight highlightParams
4949
let (Just (List locations)) = highlightRsp ^. result
5050
liftIO $ locations `shouldBe` [ DocumentHighlight
5151
{ _range = Range
@@ -126,7 +126,7 @@ spec = do
126126
let args' = H.fromList [("pos", toJSON (Position 7 0)), ("file", toJSON testUri)]
127127
args = List [Object args']
128128

129-
executeRsp <- request WorkspaceExecuteCommand (ExecuteCommandParams "hare:demote" (Just args))
129+
executeRsp <- request WorkspaceExecuteCommand (ExecuteCommandParams "hare:demote" (Just args) Nothing)
130130
liftIO $ executeRsp ^. result `shouldBe` Just (Object H.empty)
131131

132132
editReq <- message :: Session ApplyWorkspaceEditRequest

test/functional/FormatSpec.hs

+7-7
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ spec = do
3030
doc <- openDoc "Format.hs" "haskell"
3131
formatRange doc (FormattingOptions 5 True) (Range (Position 4 0) (Position 7 19))
3232
documentContents doc >>= liftIO . (`shouldBe` formattedRangeTabSize5)
33-
33+
3434
describe "formatting provider" $ do
3535
let formatLspConfig provider =
3636
object [ "languageServerHaskell" .= object ["formattingProvider" .= (provider :: Value)] ]
@@ -42,7 +42,7 @@ spec = do
4242

4343
formatDoc doc (FormattingOptions 2 True)
4444
documentContents doc >>= liftIO . (`shouldBe` orig)
45-
45+
4646
formatRange doc (FormattingOptions 2 True) (Range (Position 1 0) (Position 3 10))
4747
documentContents doc >>= liftIO . (`shouldBe` orig)
4848

@@ -60,34 +60,34 @@ spec = do
6060
sendNotification WorkspaceDidChangeConfiguration (DidChangeConfigurationParams (formatLspConfig "brittany"))
6161
formatDoc doc (FormattingOptions 2 True)
6262
documentContents doc >>= liftIO . (`shouldBe` formattedBrittanyPostFloskell)
63-
63+
6464
describe "brittany" $ do
6565
it "formats a document with LF endings" $ runSession hieCommand fullCaps "test/testdata" $ do
6666
doc <- openDoc "BrittanyLF.hs" "haskell"
67-
let opts = DocumentFormattingParams doc (FormattingOptions 4 True)
67+
let opts = DocumentFormattingParams doc (FormattingOptions 4 True) Nothing
6868
ResponseMessage _ _ (Just edits) _ <- request TextDocumentFormatting opts
6969
liftIO $ edits `shouldBe` [TextEdit (Range (Position 0 0) (Position 3 0))
7070
"foo :: Int -> String -> IO ()\nfoo x y = do\n print x\n return 42\n"]
7171

7272
it "formats a document with CRLF endings" $ runSession hieCommand fullCaps "test/testdata" $ do
7373
doc <- openDoc "BrittanyCRLF.hs" "haskell"
74-
let opts = DocumentFormattingParams doc (FormattingOptions 4 True)
74+
let opts = DocumentFormattingParams doc (FormattingOptions 4 True) Nothing
7575
ResponseMessage _ _ (Just edits) _ <- request TextDocumentFormatting opts
7676
liftIO $ edits `shouldBe` [TextEdit (Range (Position 0 0) (Position 3 0))
7777
"foo :: Int -> String -> IO ()\nfoo x y = do\n print x\n return 42\n"]
7878

7979
it "formats a range with LF endings" $ runSession hieCommand fullCaps "test/testdata" $ do
8080
doc <- openDoc "BrittanyLF.hs" "haskell"
8181
let range = Range (Position 1 0) (Position 2 22)
82-
opts = DocumentRangeFormattingParams doc range (FormattingOptions 4 True)
82+
opts = DocumentRangeFormattingParams doc range (FormattingOptions 4 True) Nothing
8383
ResponseMessage _ _ (Just edits) _ <- request TextDocumentRangeFormatting opts
8484
liftIO $ edits `shouldBe` [TextEdit (Range (Position 1 0) (Position 3 0))
8585
"foo x y = do\n print x\n return 42\n"]
8686

8787
it "formats a range with CRLF endings" $ runSession hieCommand fullCaps "test/testdata" $ do
8888
doc <- openDoc "BrittanyCRLF.hs" "haskell"
8989
let range = Range (Position 1 0) (Position 2 22)
90-
opts = DocumentRangeFormattingParams doc range (FormattingOptions 4 True)
90+
opts = DocumentRangeFormattingParams doc range (FormattingOptions 4 True) Nothing
9191
ResponseMessage _ _ (Just edits) _ <- request TextDocumentRangeFormatting opts
9292
liftIO $ edits `shouldBe` [TextEdit (Range (Position 1 0) (Position 3 0))
9393
"foo x y = do\n print x\n return 42\n"]

test/functional/FunctionalCodeActionsSpec.hs

+2-2
Original file line numberDiff line numberDiff line change
@@ -503,9 +503,9 @@ spec = describe "code actions" $ do
503503
doc <- openDoc "CodeActionOnly.hs" "haskell"
504504
_ <- count 2 waitForDiagnostics -- need to wait for both hlint and ghcmod
505505
diags <- getCurrentDiagnostics doc
506-
let params = CodeActionParams doc (Range (Position 2 10) (Position 4 0)) caContext
506+
let params = CodeActionParams doc (Range (Position 2 10) (Position 4 0)) caContext Nothing
507507
caContext = CodeActionContext (List diags) (Just (List [CodeActionRefactorInline]))
508-
ResponseMessage _ _ (Just (List res)) _ <- request TextDocumentCodeAction params :: Session CodeActionResponse
508+
ResponseMessage _ _ (Just (List res)) _ <- request TextDocumentCodeAction params
509509
let cas = map fromAction res
510510
kinds = map (^. L.kind) cas
511511
liftIO $ do

0 commit comments

Comments
 (0)