@@ -674,7 +674,7 @@ getDocumentSymbols doc = do
674
674
Right (InL xs) -> return (Left xs)
675
675
Right (InR (InL xs)) -> return (Right xs)
676
676
Right (InR (InR _)) -> return (Right [] )
677
- Left err -> throw (UnexpectedResponseError (SomeLspId $ fromJust rspLid) err)
677
+ Left err -> throw (UnexpectedResponseError (fromJust rspLid) err)
678
678
679
679
-- | Returns the code actions in the specified range.
680
680
getCodeActions :: TextDocumentIdentifier -> Range -> Session [Command |? CodeAction ]
@@ -685,7 +685,7 @@ getCodeActions doc range = do
685
685
case rsp ^. L. result of
686
686
Right (InL xs) -> return xs
687
687
Right (InR _) -> return []
688
- Left error -> throw (UnexpectedResponseError (SomeLspId $ fromJust $ rsp ^. L. id ) error )
688
+ Left error -> throw (UnexpectedResponseError (fromJust $ rsp ^. L. id ) error )
689
689
690
690
{- | Returns the code actions in the specified range, resolving any with
691
691
a non empty _data_ field.
@@ -713,7 +713,7 @@ getAllCodeActions doc = do
713
713
TResponseMessage _ rspLid res <- request SMethod_TextDocumentCodeAction (CodeActionParams Nothing Nothing doc (diag ^. L. range) ctx)
714
714
715
715
case res of
716
- Left e -> throw (UnexpectedResponseError (SomeLspId $ fromJust rspLid) e)
716
+ Left e -> throw (UnexpectedResponseError (fromJust rspLid) e)
717
717
Right (InL cmdOrCAs) -> pure (acc ++ cmdOrCAs)
718
718
Right (InR _) -> pure acc
719
719
@@ -781,7 +781,7 @@ resolveCodeAction ca = do
781
781
rsp <- request SMethod_CodeActionResolve ca
782
782
case rsp ^. L. result of
783
783
Right ca -> return ca
784
- Left er -> throw (UnexpectedResponseError (SomeLspId $ fromJust $ rsp ^. L. id ) er)
784
+ Left er -> throw (UnexpectedResponseError (fromJust $ rsp ^. L. id ) er)
785
785
786
786
{- | If a code action contains a _data_ field: resolves the code action, then
787
787
executes it. Otherwise, just executes it.
@@ -849,7 +849,7 @@ resolveCompletion ci = do
849
849
rsp <- request SMethod_CompletionItemResolve ci
850
850
case rsp ^. L. result of
851
851
Right ci -> return ci
852
- Left error -> throw (UnexpectedResponseError (SomeLspId $ fromJust $ rsp ^. L. id ) error )
852
+ Left error -> throw (UnexpectedResponseError (fromJust $ rsp ^. L. id ) error )
853
853
854
854
-- | Returns the references for the position in the document.
855
855
getReferences ::
@@ -937,11 +937,11 @@ getHighlights doc pos =
937
937
{- | Checks the response for errors and throws an exception if needed.
938
938
Returns the result if successful.
939
939
-}
940
- getResponseResult :: (ToJSON (ErrorData m )) => TResponseMessage m -> MessageResult m
940
+ getResponseResult :: (Show (ErrorData m )) => TResponseMessage m -> MessageResult m
941
941
getResponseResult rsp =
942
942
case rsp ^. L. result of
943
943
Right x -> x
944
- Left err -> throw $ UnexpectedResponseError (SomeLspId $ fromJust $ rsp ^. L. id ) err
944
+ Left err -> throw $ UnexpectedResponseError (fromJust $ rsp ^. L. id ) err
945
945
946
946
-- | Applies formatting to the specified document.
947
947
formatDoc :: TextDocumentIdentifier -> FormattingOptions -> Session ()
@@ -984,7 +984,7 @@ resolveCodeLens cl = do
984
984
rsp <- request SMethod_CodeLensResolve cl
985
985
case rsp ^. L. result of
986
986
Right cl -> return cl
987
- Left error -> throw (UnexpectedResponseError (SomeLspId $ fromJust $ rsp ^. L. id ) error )
987
+ Left error -> throw (UnexpectedResponseError (fromJust $ rsp ^. L. id ) error )
988
988
989
989
-- | Returns the inlay hints in the specified range.
990
990
getInlayHints :: TextDocumentIdentifier -> Range -> Session [InlayHint ]
@@ -1006,7 +1006,7 @@ resolveInlayHint ih = do
1006
1006
rsp <- request SMethod_InlayHintResolve ih
1007
1007
case rsp ^. L. result of
1008
1008
Right ih -> return ih
1009
- Left error -> throw (UnexpectedResponseError (SomeLspId $ fromJust $ rsp ^. L. id ) error )
1009
+ Left error -> throw (UnexpectedResponseError (fromJust $ rsp ^. L. id ) error )
1010
1010
1011
1011
-- | Pass a param and return the response from `prepareCallHierarchy`
1012
1012
prepareCallHierarchy :: CallHierarchyPrepareParams -> Session [CallHierarchyItem ]
@@ -1021,7 +1021,7 @@ outgoingCalls = resolveRequestWithListResp SMethod_CallHierarchyOutgoingCalls
1021
1021
-- | Send a request and receive a response with list.
1022
1022
resolveRequestWithListResp ::
1023
1023
forall (m :: Method ClientToServer Request ) a .
1024
- (ToJSON (ErrorData m ), MessageResult m ~ ([a ] |? Null )) =>
1024
+ (Show (ErrorData m ), MessageResult m ~ ([a ] |? Null )) =>
1025
1025
SMethod m ->
1026
1026
MessageParams m ->
1027
1027
Session [a ]
0 commit comments