mirror of
https://github.com/haskell/ghcide.git
synced 2024-09-11 05:36:09 +03:00
Upgrade to haskell-lsp-0.22 (#547)
This commit is contained in:
parent
c7c39827d3
commit
5661348b5e
@ -44,8 +44,8 @@ library
|
||||
filepath,
|
||||
haddock-library >= 1.8,
|
||||
hashable,
|
||||
haskell-lsp-types == 0.21.*,
|
||||
haskell-lsp == 0.21.*,
|
||||
haskell-lsp-types == 0.22.*,
|
||||
haskell-lsp == 0.22.*,
|
||||
mtl,
|
||||
network-uri,
|
||||
prettyprinter-ansi-terminal,
|
||||
|
@ -144,14 +144,14 @@ runLanguageServer options userHandlers onInitialConfig onConfigChange getIdeStat
|
||||
Response x@RequestMessage{_id, _params} wrap act ->
|
||||
checkCancelled ide clearReqId waitForCancel lspFuncs wrap act x _id _params $
|
||||
\case
|
||||
Left e -> sendFunc $ wrap $ ResponseMessage "2.0" (responseId _id) Nothing (Just e)
|
||||
Right r -> sendFunc $ wrap $ ResponseMessage "2.0" (responseId _id) (Just r) Nothing
|
||||
Left e -> sendFunc $ wrap $ ResponseMessage "2.0" (responseId _id) (Left e)
|
||||
Right r -> sendFunc $ wrap $ ResponseMessage "2.0" (responseId _id) (Right r)
|
||||
ResponseAndRequest x@RequestMessage{_id, _params} wrap wrapNewReq act ->
|
||||
checkCancelled ide clearReqId waitForCancel lspFuncs wrap act x _id _params $
|
||||
\(res, newReq) -> do
|
||||
case res of
|
||||
Left e -> sendFunc $ wrap $ ResponseMessage "2.0" (responseId _id) Nothing (Just e)
|
||||
Right r -> sendFunc $ wrap $ ResponseMessage "2.0" (responseId _id) (Just r) Nothing
|
||||
Left e -> sendFunc $ wrap $ ResponseMessage "2.0" (responseId _id) (Left e)
|
||||
Right r -> sendFunc $ wrap $ ResponseMessage "2.0" (responseId _id) (Right r)
|
||||
whenJust newReq $ \(rm, newReqParams) -> do
|
||||
reqId <- getNextReqId
|
||||
sendFunc $ wrapNewReq $ RequestMessage "2.0" reqId rm newReqParams
|
||||
@ -175,16 +175,16 @@ runLanguageServer options userHandlers onInitialConfig onConfigChange getIdeStat
|
||||
Left () -> do
|
||||
logDebug (ideLogger ide) $ T.pack $
|
||||
"Cancelled request " <> show _id
|
||||
sendFunc $ wrap $ ResponseMessage "2.0" (responseId _id) Nothing $
|
||||
Just $ ResponseError RequestCancelled "" Nothing
|
||||
sendFunc $ wrap $ ResponseMessage "2.0" (responseId _id) $ Left
|
||||
$ ResponseError RequestCancelled "" Nothing
|
||||
Right res -> k res
|
||||
) $ \(e :: SomeException) -> do
|
||||
logError (ideLogger ide) $ T.pack $
|
||||
"Unexpected exception on request, please report!\n" ++
|
||||
"Message: " ++ show msg ++ "\n" ++
|
||||
"Exception: " ++ show e
|
||||
sendFunc $ wrap $ ResponseMessage "2.0" (responseId _id) Nothing $
|
||||
Just $ ResponseError InternalError (T.pack $ show e) Nothing
|
||||
sendFunc $ wrap $ ResponseMessage "2.0" (responseId _id) $ Left
|
||||
$ ResponseError InternalError (T.pack $ show e) Nothing
|
||||
|
||||
initializeRequestHandler :: PartialHandlers config
|
||||
initializeRequestHandler = PartialHandlers $ \WithMessage{..} x -> return x{
|
||||
|
@ -2,9 +2,9 @@ resolver: nightly-2019-09-16
|
||||
packages:
|
||||
- .
|
||||
extra-deps:
|
||||
- haskell-lsp-0.21.0.0
|
||||
- haskell-lsp-types-0.21.0.0
|
||||
- lsp-test-0.10.2.0
|
||||
- haskell-lsp-0.22.0.0
|
||||
- haskell-lsp-types-0.22.0.0
|
||||
- lsp-test-0.10.3.0
|
||||
- hie-bios-0.4.0
|
||||
- ghc-lib-parser-8.8.1
|
||||
- ghc-lib-8.8.1
|
||||
|
@ -2,9 +2,9 @@ resolver: nightly-2019-09-21
|
||||
packages:
|
||||
- .
|
||||
extra-deps:
|
||||
- haskell-lsp-0.21.0.0
|
||||
- haskell-lsp-types-0.21.0.0
|
||||
- lsp-test-0.10.2.0
|
||||
- haskell-lsp-0.22.0.0
|
||||
- haskell-lsp-types-0.22.0.0
|
||||
- lsp-test-0.10.3.0
|
||||
- hie-bios-0.4.0
|
||||
- fuzzy-0.1.0.0
|
||||
- regex-pcre-builtin-0.95.1.1.8.43
|
||||
|
@ -4,9 +4,9 @@ allow-newer: true
|
||||
packages:
|
||||
- .
|
||||
extra-deps:
|
||||
- haskell-lsp-0.21.0.0
|
||||
- haskell-lsp-types-0.21.0.0
|
||||
- lsp-test-0.10.2.0
|
||||
- haskell-lsp-0.22.0.0
|
||||
- haskell-lsp-types-0.22.0.0
|
||||
- lsp-test-0.10.3.0
|
||||
- ghc-check-0.3.0.1
|
||||
|
||||
# for ghc-8.10
|
||||
|
@ -5,9 +5,9 @@ packages:
|
||||
extra-deps:
|
||||
- aeson-1.4.6.0
|
||||
- base-orphans-0.8.2
|
||||
- haskell-lsp-0.21.0.0
|
||||
- haskell-lsp-types-0.21.0.0
|
||||
- lsp-test-0.10.2.0
|
||||
- haskell-lsp-0.22.0.0
|
||||
- haskell-lsp-types-0.22.0.0
|
||||
- lsp-test-0.10.3.0
|
||||
- rope-utf16-splay-0.3.1.0
|
||||
- filepattern-0.1.1
|
||||
- js-dgtable-0.5.2
|
||||
|
@ -2,9 +2,10 @@ resolver: nightly-2020-02-13
|
||||
packages:
|
||||
- .
|
||||
extra-deps:
|
||||
- haskell-lsp-0.21.0.0
|
||||
- haskell-lsp-types-0.21.0.0
|
||||
- lsp-test-0.10.2.0
|
||||
- haskell-lsp-0.22.0.0
|
||||
- haskell-lsp-types-0.22.0.0
|
||||
- lsp-test-0.10.3.0
|
||||
- ghc-check-0.3.0.1
|
||||
|
||||
nix:
|
||||
packages: [zlib]
|
||||
|
@ -135,7 +135,7 @@ initializeResponseTests = withResource acquire release tests where
|
||||
|
||||
|
||||
innerCaps :: InitializeResponse -> InitializeResponseCapabilitiesInner
|
||||
innerCaps (ResponseMessage _ _ (Just (InitializeResponseCapabilities c)) _) = c
|
||||
innerCaps (ResponseMessage _ _ (Right (InitializeResponseCapabilities c))) = c
|
||||
innerCaps _ = error "this test only expects inner capabilities"
|
||||
|
||||
acquire :: IO InitializeResponse
|
||||
|
Loading…
Reference in New Issue
Block a user