LSP: replace LanguageClientNull with nullptr_t

Prevent implicit converting of the null type to JsonObjects or
JsonValues.

Change-Id: Ib1b74d8a7962cbb308ad0d1bca117cfd2130fb1b
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
This commit is contained in:
David Schulz
2019-01-07 13:24:01 +01:00
parent b2638f8ac3
commit 108f83f336
10 changed files with 70 additions and 41 deletions

View File

@@ -617,7 +617,7 @@ void BaseClient::handleMethod(const QString &method, MessageId id, const IConten
} else {
ShowMessageRequest::Response response;
response.setId(request->id());
ResponseError<LanguageClientNull> error;
ResponseError<std::nullptr_t> error;
const QString errorMessage =
QString("Could not parse ShowMessageRequest parameter of '%1': \"%2\"")
.arg(request->id().toString(),
@@ -696,9 +696,9 @@ void BaseClient::intializeCallback(const InitializeRequest::Response &initRespon
void BaseClient::shutDownCallback(const ShutdownRequest::Response &shutdownResponse)
{
QTC_ASSERT(m_state == ShutdownRequested, return);
optional<ResponseError<JsonObject>> errorValue = shutdownResponse.error();
optional<ShutdownRequest::Response::Error> errorValue = shutdownResponse.error();
if (errorValue.has_value()) {
ResponseError<JsonObject> error = errorValue.value();
ShutdownRequest::Response::Error error = errorValue.value();
qDebug() << error;
return;
}