on master help sign in
Upgrade to haskell-lsp-0.22 (#547)
commit5661348b5e47d2abbd9f6f8d44da8ccab5b807a8 authorLuke Lau <luke_lau@icloud.com> dateWed 13 May 2020, 13:59 (6 years ago) parentc7c3982
8 files changed+27−26
ghcide.cabal+2−2 src/Development/IDE/LSP/LanguageServer.hs+8−8 stack-ghc-lib.yaml+3−3 stack.yaml+3−3 stack810.yaml+3−3 stack84.yaml+3−3 stack88.yaml+4−3 test/exe/Main.hs+1−1
ghcide.cabal+2−2
@@ -44,8 +44,8 @@ library
4444 filepath,
4545 haddock-library >= 1.8,
4646 hashable,
47− haskell-lsp-types == 0.21.*,
48− haskell-lsp == 0.21.*,
47+ haskell-lsp-types == 0.22.*,
48+ haskell-lsp == 0.22.*,
4949 mtl,
5050 network-uri,
5151 prettyprinter-ansi-terminal,
src/Development/IDE/LSP/LanguageServer.hs+8−8
@@ -144,14 +144,14 @@ runLanguageServer options userHandlers onInitialConfig onConfigChange getIdeStat
144144 Response x@RequestMessage{_id, _params} wrap act ->
145145 checkCancelled ide clearReqId waitForCancel lspFuncs wrap act x _id _params $
146146 \case
147− Left e -> sendFunc $ wrap $ ResponseMessage "2.0" (responseId _id) Nothing (Just e)
148− Right r -> sendFunc $ wrap $ ResponseMessage "2.0" (responseId _id) (Just r) Nothing
147+ Left e -> sendFunc $ wrap $ ResponseMessage "2.0" (responseId _id) (Left e)
148+ Right r -> sendFunc $ wrap $ ResponseMessage "2.0" (responseId _id) (Right r)
149149 ResponseAndRequest x@RequestMessage{_id, _params} wrap wrapNewReq act ->
150150 checkCancelled ide clearReqId waitForCancel lspFuncs wrap act x _id _params $
151151 \(res, newReq) -> do
152152 case res of
153− Left e -> sendFunc $ wrap $ ResponseMessage "2.0" (responseId _id) Nothing (Just e)
154− Right r -> sendFunc $ wrap $ ResponseMessage "2.0" (responseId _id) (Just r) Nothing
153+ Left e -> sendFunc $ wrap $ ResponseMessage "2.0" (responseId _id) (Left e)
154+ Right r -> sendFunc $ wrap $ ResponseMessage "2.0" (responseId _id) (Right r)
155155 whenJust newReq $ \(rm, newReqParams) -> do
156156 reqId <- getNextReqId
157157 sendFunc $ wrapNewReq $ RequestMessage "2.0" reqId rm newReqParams
@@ -175,16 +175,16 @@ runLanguageServer options userHandlers onInitialConfig onConfigChange getIdeStat
175175 Left () -> do
176176 logDebug (ideLogger ide) $ T.pack $
177177 "Cancelled request " <> show _id
178− sendFunc $ wrap $ ResponseMessage "2.0" (responseId _id) Nothing $
179− Just $ ResponseError RequestCancelled "" Nothing
178+ sendFunc $ wrap $ ResponseMessage "2.0" (responseId _id) $ Left
179+ $ ResponseError RequestCancelled "" Nothing
180180 Right res -> k res
181181 ) $ \(e :: SomeException) -> do
182182 logError (ideLogger ide) $ T.pack $
183183 "Unexpected exception on request, please report!\n" ++
184184 "Message: " ++ show msg ++ "\n" ++
185185 "Exception: " ++ show e
186− sendFunc $ wrap $ ResponseMessage "2.0" (responseId _id) Nothing $
187− Just $ ResponseError InternalError (T.pack $ show e) Nothing
186+ sendFunc $ wrap $ ResponseMessage "2.0" (responseId _id) $ Left
187+ $ ResponseError InternalError (T.pack $ show e) Nothing
188188
189189initializeRequestHandler :: PartialHandlers config
190190initializeRequestHandler = PartialHandlers $ \WithMessage{..} x -> return x{
stack-ghc-lib.yaml+3−3
@@ -2,9 +2,9 @@ resolver: nightly-2019-09-16
22packages:
33- .
44extra-deps:
5−- haskell-lsp-0.21.0.0
6−- haskell-lsp-types-0.21.0.0
7−- lsp-test-0.10.2.0
5+- haskell-lsp-0.22.0.0
6+- haskell-lsp-types-0.22.0.0
7+- lsp-test-0.10.3.0
88- hie-bios-0.4.0
99- ghc-lib-parser-8.8.1
1010- ghc-lib-8.8.1
stack.yaml+3−3
@@ -2,9 +2,9 @@ resolver: nightly-2019-09-21
22packages:
33- .
44extra-deps:
5−- haskell-lsp-0.21.0.0
6−- haskell-lsp-types-0.21.0.0
7−- lsp-test-0.10.2.0
5+- haskell-lsp-0.22.0.0
6+- haskell-lsp-types-0.22.0.0
7+- lsp-test-0.10.3.0
88- hie-bios-0.4.0
99- fuzzy-0.1.0.0
1010- regex-pcre-builtin-0.95.1.1.8.43
stack810.yaml+3−3
@@ -4,9 +4,9 @@ allow-newer: true
44packages:
55- .
66extra-deps:
7−- haskell-lsp-0.21.0.0
8−- haskell-lsp-types-0.21.0.0
9−- lsp-test-0.10.2.0
7+- haskell-lsp-0.22.0.0
8+- haskell-lsp-types-0.22.0.0
9+- lsp-test-0.10.3.0
1010- ghc-check-0.3.0.1
1111
1212# for ghc-8.10
stack84.yaml+3−3
@@ -5,9 +5,9 @@ packages:
55extra-deps:
66- aeson-1.4.6.0
77- base-orphans-0.8.2
8−- haskell-lsp-0.21.0.0
9−- haskell-lsp-types-0.21.0.0
10−- lsp-test-0.10.2.0
8+- haskell-lsp-0.22.0.0
9+- haskell-lsp-types-0.22.0.0
10+- lsp-test-0.10.3.0
1111- rope-utf16-splay-0.3.1.0
1212- filepattern-0.1.1
1313- js-dgtable-0.5.2
stack88.yaml+4−3
@@ -2,9 +2,10 @@ resolver: nightly-2020-02-13
22packages:
33- .
44extra-deps:
5−- haskell-lsp-0.21.0.0
6−- haskell-lsp-types-0.21.0.0
7−- lsp-test-0.10.2.0
5+- haskell-lsp-0.22.0.0
6+- haskell-lsp-types-0.22.0.0
7+- lsp-test-0.10.3.0
88- ghc-check-0.3.0.1
9+
910nix:
1011 packages: [zlib]
test/exe/Main.hs+1−1
@@ -135,7 +135,7 @@ initializeResponseTests = withResource acquire release tests where
135135
136136
137137 innerCaps :: InitializeResponse -> InitializeResponseCapabilitiesInner
138− innerCaps (ResponseMessage _ _ (Just (InitializeResponseCapabilities c)) _) = c
138+ innerCaps (ResponseMessage _ _ (Right (InitializeResponseCapabilities c))) = c
139139 innerCaps _ = error "this test only expects inner capabilities"
140140
141141 acquire :: IO InitializeResponse