From 512da70456724eefac92ef02b8a4807ebb57c178 Mon Sep 17 00:00:00 2001 From: David Schulz Date: Wed, 23 Aug 2023 10:50:22 +0200 Subject: [PATCH] LanguageClient: fill workspace configuration response There is already a way to programmatically set the configuration for a client, take this into account when generating the response for a workspace configuration response. Change-Id: Id59b643eefc59732c856c356317764e6c54af69a Reviewed-by: Christian Stenger --- src/plugins/languageclient/client.cpp | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/src/plugins/languageclient/client.cpp b/src/plugins/languageclient/client.cpp index 1d18b0b189d..ff646316e02 100644 --- a/src/plugins/languageclient/client.cpp +++ b/src/plugins/languageclient/client.cpp @@ -1947,9 +1947,14 @@ void ClientPrivate::handleMethod(const QString &method, const MessageId &id, con if (QTC_GUARD(id.isValid())) response.setId(id); ConfigurationRequest configurationRequest(message.toJsonObject()); - if (auto params = configurationRequest.params()) { - for (int i = 0, end = params->items().count(); i < end; ++i) - result.append({}); + if (std::optional params = configurationRequest.params()) { + const QList items = params->items(); + for (const ConfigurationParams::ConfigurationItem &item : items) { + if (const std::optional section = item.section()) + result.append(m_configuration[*section]); + else + result.append({}); + } } response.setResult(result); sendResponse(response);