Merge pull request #37320 from fwcd/sourcekit-diagnostic-ids

[SourceKit] Add id and category to diagnostics
This commit is contained in:
Ben Langmuir
2021-05-17 14:25:40 -07:00
committed by GitHub
31 changed files with 228 additions and 65 deletions

View File

@@ -100,6 +100,14 @@ void EditorDiagConsumer::handleDiagnostic(SourceManager &SM,
DiagnosticEntryInfo SKInfo;
SKInfo.ID = DiagnosticEngine::diagnosticIDStringFor(Info.ID).str();
if (Info.Category == "deprecation") {
SKInfo.Categories.push_back(DiagnosticCategory::Deprecation);
} else if (Info.Category == "no-usage") {
SKInfo.Categories.push_back(DiagnosticCategory::NoUsage);
}
// Actually substitute the diagnostic arguments into the diagnostic text.
llvm::SmallString<256> Text;
{