Commit 7214f460 authored by Mark Nauwelaerts's avatar Mark Nauwelaerts

lspclient: support error handling for documentSymbols request

parent d6f057a6
......@@ -1097,10 +1097,10 @@ public:
}
}
RequestHandle documentSymbols(const QUrl &document, const GenericReplyHandler &h)
RequestHandle documentSymbols(const QUrl &document, const GenericReplyHandler &h, const GenericReplyHandler &eh)
{
auto params = textDocumentParams(document);
return send(init_request(QStringLiteral("textDocument/documentSymbol"), params), h);
return send(init_request(QStringLiteral("textDocument/documentSymbol"), params), h, eh);
}
RequestHandle documentDefinition(const QUrl &document, const LSPPosition &pos, const GenericReplyHandler &h)
......@@ -1342,9 +1342,9 @@ int LSPClientServer::cancel(int reqid)
return d->cancel(reqid);
}
LSPClientServer::RequestHandle LSPClientServer::documentSymbols(const QUrl &document, const QObject *context, const DocumentSymbolsReplyHandler &h)
LSPClientServer::RequestHandle LSPClientServer::documentSymbols(const QUrl &document, const QObject *context, const DocumentSymbolsReplyHandler &h, const ErrorReplyHandler &eh)
{
return d->documentSymbols(document, make_handler(h, context, parseDocumentSymbols));
return d->documentSymbols(document, make_handler(h, context, parseDocumentSymbols), make_handler(eh, context, parseResponseError));
}
LSPClientServer::RequestHandle LSPClientServer::documentDefinition(const QUrl &document, const LSPPosition &pos, const QObject *context, const DocumentDefinitionReplyHandler &h)
......
......@@ -120,7 +120,7 @@ public:
const LSPServerCapabilities &capabilities() const;
// language
RequestHandle documentSymbols(const QUrl &document, const QObject *context, const DocumentSymbolsReplyHandler &h);
RequestHandle documentSymbols(const QUrl &document, const QObject *context, const DocumentSymbolsReplyHandler &h, const ErrorReplyHandler &eh = nullptr);
RequestHandle documentDefinition(const QUrl &document, const LSPPosition &pos, const QObject *context, const DocumentDefinitionReplyHandler &h);
RequestHandle documentDeclaration(const QUrl &document, const LSPPosition &pos, const QObject *context, const DocumentDefinitionReplyHandler &h);
RequestHandle documentHighlight(const QUrl &document, const LSPPosition &pos, const QObject *context, const DocumentHighlightReplyHandler &h);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment