forked from qt-creator/qt-creator
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 <christian.stenger@qt.io>
This commit is contained in:
@@ -1947,10 +1947,15 @@ void ClientPrivate::handleMethod(const QString &method, const MessageId &id, con
|
|||||||
if (QTC_GUARD(id.isValid()))
|
if (QTC_GUARD(id.isValid()))
|
||||||
response.setId(id);
|
response.setId(id);
|
||||||
ConfigurationRequest configurationRequest(message.toJsonObject());
|
ConfigurationRequest configurationRequest(message.toJsonObject());
|
||||||
if (auto params = configurationRequest.params()) {
|
if (std::optional<ConfigurationParams> params = configurationRequest.params()) {
|
||||||
for (int i = 0, end = params->items().count(); i < end; ++i)
|
const QList<ConfigurationParams::ConfigurationItem> items = params->items();
|
||||||
|
for (const ConfigurationParams::ConfigurationItem &item : items) {
|
||||||
|
if (const std::optional<QString> section = item.section())
|
||||||
|
result.append(m_configuration[*section]);
|
||||||
|
else
|
||||||
result.append({});
|
result.append({});
|
||||||
}
|
}
|
||||||
|
}
|
||||||
response.setResult(result);
|
response.setResult(result);
|
||||||
sendResponse(response);
|
sendResponse(response);
|
||||||
} else if (isRequest) {
|
} else if (isRequest) {
|
||||||
|
Reference in New Issue
Block a user