Swift: support markdown TSP diagnostics

This commit is contained in:
Paolo Tranquilli
2023-05-15 12:41:30 +02:00
parent d8c0054ea9
commit cfcd26cf0d
7 changed files with 42 additions and 22 deletions

View File

@@ -25,7 +25,8 @@ nlohmann::json SwiftDiagnostic::json(const std::chrono::system_clock::time_point
}},
{"severity", "error"},
{"helpLinks", std::vector<std::string_view>(absl::StrSplit(helpLinks, ' '))},
{"plaintextMessage", absl::StrCat(message, ".\n\n", action, ".")},
{format == Format::markdown ? "markdownMessage" : "plaintextMessage",
absl::StrCat(message, ".\n\n", action)},
{"timestamp", fmt::format("{:%FT%T%z}", timestamp)},
};
if (location) {