mirror of
https://github.com/ethereum/solidity
synced 2023-10-03 13:03:40 +00:00
more conversions
This commit is contained in:
parent
35804e7866
commit
da5f0160d9
@ -509,7 +509,7 @@ std::optional<Json> checkMetadataKeys(Json const& _input)
|
||||
{
|
||||
if (_input.is_object())
|
||||
{
|
||||
if (_input.contains("appendCBOR") && !_input["appendCBOR"].is_boolean))
|
||||
if (_input.contains("appendCBOR") && !_input["appendCBOR"].is_boolean())
|
||||
return formatFatalError(Error::Type::JSONError, "\"settings.metadata.appendCBOR\" must be Boolean");
|
||||
if (_input.contains("useLiteralContent") && !_input["useLiteralContent"].is_boolean())
|
||||
return formatFatalError(Error::Type::JSONError, "\"settings.metadata.useLiteralContent\" must be Boolean");
|
||||
@ -585,7 +585,8 @@ std::variant<OptimiserSettings, Json> parseOptimizerSettings(Json const& _jsonIn
|
||||
{
|
||||
if (!_jsonInput["runs"].is_number_unsigned())
|
||||
return formatFatalError(Error::Type::JSONError, "The \"runs\" setting must be an unsigned number.");
|
||||
settings.expectedExecutionsPerDeployment = _jsonInput["runs"].get<Json::number_unsigned_t>();
|
||||
// TODO: check size
|
||||
settings.expectedExecutionsPerDeployment = static_cast<size_t>(_jsonInput["runs"].get<Json::number_unsigned_t>());
|
||||
}
|
||||
|
||||
if (_jsonInput.contains("details"))
|
||||
|
@ -58,7 +58,7 @@ struct MarkdownBuilder
|
||||
|
||||
}
|
||||
|
||||
void DocumentHoverHandler::operator()(MessageID _id, Json::Value const& _args)
|
||||
void DocumentHoverHandler::operator()(MessageID _id, Json const& _args)
|
||||
{
|
||||
auto const [sourceUnitName, lineColumn] = HandlerBase(*this).extractSourceUnitNameAndLineColumn(_args);
|
||||
auto const [sourceNode, sourceOffset] = m_server.astNodeAndOffsetAtSourceLocation(sourceUnitName, lineColumn);
|
||||
@ -111,11 +111,11 @@ void DocumentHoverHandler::operator()(MessageID _id, Json::Value const& _args)
|
||||
|
||||
if (tooltipText.empty())
|
||||
{
|
||||
client().reply(_id, Json::nullValue);
|
||||
client().reply(_id, Json{});
|
||||
return;
|
||||
}
|
||||
|
||||
Json::Value reply = Json::objectValue;
|
||||
Json reply = Json::object();
|
||||
reply["range"] = rangeToHighlight;
|
||||
reply["contents"]["kind"] = "markdown";
|
||||
reply["contents"]["value"] = std::move(tooltipText);
|
||||
|
@ -26,7 +26,7 @@ class DocumentHoverHandler: public HandlerBase
|
||||
public:
|
||||
using HandlerBase::HandlerBase;
|
||||
|
||||
void operator()(MessageID, Json::Value const&);
|
||||
void operator()(MessageID, Json const&);
|
||||
};
|
||||
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user