forked from qt-creator/qt-creator
LanguageClient: send out empty workspace configurations
... instead of an error when the server asks for the configuration even if we do not provide a way to configure workspace configurations yet. Change-Id: I0d330b47a12627af100bf9d9b1eec34a58d6471b Reviewed-by: Christian Stenger <christian.stenger@qt.io>
This commit is contained in:
@@ -109,8 +109,8 @@ public:
|
||||
bool isValid() const override { return contains(itemsKey); }
|
||||
};
|
||||
|
||||
class LANGUAGESERVERPROTOCOL_EXPORT ConfigurationRequest : public Request<
|
||||
LanguageClientArray<QJsonValue>, std::nullptr_t, ConfigurationParams>
|
||||
class LANGUAGESERVERPROTOCOL_EXPORT ConfigurationRequest
|
||||
: public Request<QJsonArray, std::nullptr_t, ConfigurationParams>
|
||||
{
|
||||
public:
|
||||
explicit ConfigurationRequest(const ConfigurationParams ¶ms);
|
||||
|
@@ -1941,6 +1941,18 @@ void ClientPrivate::handleMethod(const QString &method, const MessageId &id, con
|
||||
if (ProgressManager::isProgressEndMessage(*params))
|
||||
emit q->workDone(params->token());
|
||||
}
|
||||
} else if (method == ConfigurationRequest::methodName) {
|
||||
ConfigurationRequest::Response response;
|
||||
QJsonArray result;
|
||||
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({});
|
||||
}
|
||||
response.setResult(result);
|
||||
sendResponse(response);
|
||||
} else if (isRequest) {
|
||||
Response<JsonObject, JsonObject> response(id);
|
||||
ResponseError<JsonObject> error;
|
||||
|
Reference in New Issue
Block a user