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

lspclient: add server support for didChangeConfiguration

See issue #5
parent 8c7011c8
......@@ -231,6 +231,11 @@ static QJsonObject applyWorkspaceEditResponse(const LSPApplyWorkspaceEditRespons
return QJsonObject {{QStringLiteral("applied"), response.applied}, {QStringLiteral("failureReason"), response.failureReason}};
}
static QJsonObject changeConfigurationParams(const QJsonValue &settings)
{
return QJsonObject {{QStringLiteral("settings"), settings}};
}
static void from_json(QVector<QChar> &trigger, const QJsonValue &json)
{
for (const auto &t : json.toArray()) {
......@@ -1154,6 +1159,12 @@ public:
send(init_request(QStringLiteral("textDocument/didClose"), params));
}
void didChangeConfiguration(const QJsonValue &settings)
{
auto params = changeConfigurationParams(settings);
send(init_request(QStringLiteral("workspace/didChangeConfiguration"), params));
}
void processNotification(const QJsonObject &msg)
{
auto method = msg[MEMBER_METHOD].toString();
......@@ -1362,3 +1373,8 @@ void LSPClientServer::didClose(const QUrl &document)
{
return d->didClose(document);
}
void LSPClientServer::didChangeConfiguration(const QJsonValue &settings)
{
return d->didChangeConfiguration(settings);
}
......@@ -141,6 +141,9 @@ public:
void didSave(const QUrl &document, const QString &text);
void didClose(const QUrl &document);
// misc
void didChangeConfiguration(const QJsonValue &settings);
// notification = signal
Q_SIGNALS:
void publishDiagnostics(const LSPPublishDiagnosticsParams &);
......
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