+ case mRes of
+ Just (DSDocumentSymbols (List xs)) -> return (Left xs)
+ Just (DSSymbolInformation (List xs)) -> return (Right xs)
+ Nothing -> Prelude.error "No result and no error in DocumentSymbolsResponse"
+
+-- | Returns the code actions in the specified range.
+getCodeActions :: TextDocumentIdentifier -> Range -> Session [CAResult]
+getCodeActions doc range = do
+ ctx <- getCodeActionContext doc
+ rsp <- request TextDocumentCodeAction (CodeActionParams doc range ctx)
+
+ case rsp ^. result of
+ Just (List xs) -> return xs
+ _ -> throw (UnexpectedResponseError (rsp ^. LSP.id) (fromJust $ rsp ^. LSP.error))