Commit de555d54 authored by Mark Nauwelaerts's avatar Mark Nauwelaerts
Browse files

lspclient: add server support for custom clangd memoryUsage request

parent 23f99971
......@@ -1375,6 +1375,11 @@ public:
return send(init_request(QStringLiteral("textDocument/switchSourceHeader"), params), h);
}
RequestHandle clangdMemoryUsage(const GenericReplyHandler &h)
{
return send(init_request(QStringLiteral("$/memoryUsage"), QJsonObject()), h);
}
RequestHandle documentFormatting(const QUrl &document, const LSPFormattingOptions &options, const GenericReplyHandler &h)
{
auto params = documentRangeFormattingParams(document, nullptr, options);
......@@ -1690,6 +1695,14 @@ LSPClientServer::RequestHandle LSPClientServer::clangdSwitchSourceHeader(const Q
return d->clangdSwitchSourceHeader(document, make_handler(h, context, parseClangdSwitchSourceHeader));
}
LSPClientServer::RequestHandle LSPClientServer::clangdMemoryUsage(const QObject *context, const MemoryUsageHandler &h)
{
auto identity = [](const auto &p) {
return p;
};
return d->clangdMemoryUsage(make_handler(h, context, identity));
}
LSPClientServer::RequestHandle
LSPClientServer::documentFormatting(const QUrl &document, const LSPFormattingOptions &options, const QObject *context, const FormattingReplyHandler &h)
{
......
......@@ -66,6 +66,7 @@ using WorkspaceEditReplyHandler = ReplyHandler<LSPWorkspaceEdit>;
using ApplyEditReplyHandler = ReplyHandler<LSPApplyWorkspaceEditResponse>;
using WorkspaceFoldersReplyHandler = ReplyHandler<QList<LSPWorkspaceFolder>>;
using SwitchSourceHeaderHandler = ReplyHandler<QString>;
using MemoryUsageHandler = ReplyHandler<QJsonValue>;
using SemanticTokensDeltaReplyHandler = ReplyHandler<LSPSemanticTokensDelta>;
using WorkspaceSymbolsReplyHandler = ReplyHandler<std::vector<LSPSymbolInformation>>;
......@@ -134,6 +135,7 @@ public:
// clangd specific
RequestHandle clangdSwitchSourceHeader(const QUrl &document, const QObject *context, const SwitchSourceHeaderHandler &h);
RequestHandle clangdMemoryUsage(const QObject *context, const MemoryUsageHandler &h);
RequestHandle documentFormatting(const QUrl &document, const LSPFormattingOptions &options, const QObject *context, const FormattingReplyHandler &h);
RequestHandle documentRangeFormatting(const QUrl &document,
......
Supports Markdown
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