[SourceKit] Include generated macro buffers in diagnostic responses

Introduce a new key `generated_buffers`, which
stores an array of generated buffers. These
include the buffer text, as well as its original
location and any parent buffers.

While here, also fix rdar://107281079 such that
only apply the filename fallback logic to the
pretty-printed Decl case. We ought to remove this
fallback once the editor can handle it though.

rdar://107281079
rdar://107952288
This commit is contained in:
Hamish Knight
2023-05-02 16:21:44 +01:00
parent 100244a0c3
commit 62b021030f
15 changed files with 979 additions and 145 deletions

View File

@@ -100,10 +100,10 @@ private:
bool diagnosticsEnabled() override { return true; }
void setDiagnosticStage(UIdent diagStage) override { DiagStage = diagStage; }
void handleDiagnostic(const DiagnosticEntryInfo &Info,
UIdent DiagStage) override {
Diags.push_back(Info);
void handleDiagnostics(ArrayRef<DiagnosticEntryInfo> DiagInfos,
UIdent DiagStage) override {
this->DiagStage = DiagStage;
Diags.insert(Diags.end(), DiagInfos.begin(), DiagInfos.end());
}
void handleSourceText(StringRef Text) override {}