[vcpkg] Emit parse errors to match '<file>:<line>:<col>: error: <text>' for better IDE compatibility
MODIFY
src/vcpkg-test/json.cpp
src/vcpkg-test/json.cpp
@@ -234,7 +234,7 @@ TEST_CASE ("JSON track newlines", "[json]")
auto res = Json::parse("{\n,", fs::u8path("filename"));
REQUIRE(!res);
REQUIRE(res.error()->format() ==
- R"(Error: filename:2:1: Unexpected character; expected property name
+ R"(filename:2:1: error: Unexpected character; expected property name
on expression: ,
^
)");

MODIFY
src/vcpkg/base/json.cpp
src/vcpkg/base/json.cpp
@@ -1062,7 +1062,7 @@ namespace vcpkg::Json
ExpectedT<std::pair<Value, JsonStyle>, std::unique_ptr<Parse::IParseError>> parse(StringView json,
const fs::path& filepath) noexcept
{
- return Parser::parse(json, fs::generic_u8string(filepath));
+ return Parser::parse(json, fs::u8string(filepath));
}
ExpectedT<std::pair<Value, JsonStyle>, std::unique_ptr<Parse::IParseError>> parse(StringView json,
StringView origin) noexcept

MODIFY
src/vcpkg/base/parse.cpp
src/vcpkg/base/parse.cpp
@@ -34,13 +34,12 @@ namespace vcpkg::Parse
caret_spacing.push_back(cp == '\t' ? '\t' : ' ');
}
- return Strings::concat("Error: ",
- origin,
+ return Strings::concat(origin,
":",
row,
":",
column,
- ": ",
+ ": error: ",
message,
"\n"
" on expression: ", // 18 columns

[vcpkg] Emit parse errors to match '<file>:<line>:<col>: error: <text>' for better IDE compatibility (#15926)

Co-authored-by: Robert Schumacher <roschuma@microsoft.com>