forked from qt-creator/qt-creator
Utils: Remove Utils::optional
Since we are now requiring macOS 10.14 we can remove our local implementation of optional and use std::optional for macOS too. Change-Id: I2bd018261b68da64f7f031a812045dd7784697e1 Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> Reviewed-by: <github-actions-qt-creator@cristianadam.eu> Reviewed-by: Marco Bubke <marco.bubke@qt.io>
This commit is contained in:
@@ -49,11 +49,11 @@ HoverRequest::HoverRequest(const TextDocumentPositionParams ¶ms)
|
||||
: Request(methodName, params)
|
||||
{ }
|
||||
|
||||
Utils::optional<MarkupOrString> ParameterInformation::documentation() const
|
||||
std::optional<MarkupOrString> ParameterInformation::documentation() const
|
||||
{
|
||||
QJsonValue documentation = value(documentationKey);
|
||||
if (documentation.isUndefined())
|
||||
return Utils::nullopt;
|
||||
return std::nullopt;
|
||||
return MarkupOrString(documentation);
|
||||
}
|
||||
|
||||
@@ -81,7 +81,7 @@ DocumentSymbolsRequest::DocumentSymbolsRequest(const DocumentSymbolParams ¶m
|
||||
: Request(methodName, params)
|
||||
{ }
|
||||
|
||||
Utils::optional<QList<CodeActionKind> > CodeActionParams::CodeActionContext::only() const
|
||||
std::optional<QList<CodeActionKind> > CodeActionParams::CodeActionContext::only() const
|
||||
{
|
||||
return optionalArray<CodeActionKind>(onlyKey);
|
||||
}
|
||||
@@ -180,16 +180,16 @@ RenameRequest::RenameRequest(const RenameParams ¶ms)
|
||||
: Request(methodName, params)
|
||||
{ }
|
||||
|
||||
Utils::optional<DocumentUri> DocumentLink::target() const
|
||||
std::optional<DocumentUri> DocumentLink::target() const
|
||||
{
|
||||
if (Utils::optional<QString> optionalTarget = optionalValue<QString>(targetKey))
|
||||
return Utils::make_optional(DocumentUri::fromProtocol(*optionalTarget));
|
||||
return Utils::nullopt;
|
||||
if (std::optional<QString> optionalTarget = optionalValue<QString>(targetKey))
|
||||
return std::make_optional(DocumentUri::fromProtocol(*optionalTarget));
|
||||
return std::nullopt;
|
||||
}
|
||||
|
||||
Utils::optional<QJsonValue> DocumentLink::data() const
|
||||
std::optional<QJsonValue> DocumentLink::data() const
|
||||
{
|
||||
return contains(dataKey) ? Utils::make_optional(value(dataKey)) : Utils::nullopt;
|
||||
return contains(dataKey) ? std::make_optional(value(dataKey)) : std::nullopt;
|
||||
}
|
||||
|
||||
TextDocumentParams::TextDocumentParams()
|
||||
@@ -376,9 +376,9 @@ PrepareRenameResult::PrepareRenameResult(const QJsonValue &val)
|
||||
}
|
||||
}
|
||||
|
||||
Utils::optional<QJsonValue> CodeLens::data() const
|
||||
std::optional<QJsonValue> CodeLens::data() const
|
||||
{
|
||||
return contains(dataKey) ? Utils::make_optional(value(dataKey)) : Utils::nullopt;
|
||||
return contains(dataKey) ? std::make_optional(value(dataKey)) : std::nullopt;
|
||||
}
|
||||
|
||||
HoverResult::HoverResult(const QJsonValue &value)
|
||||
|
||||
Reference in New Issue
Block a user