mirror of
https://github.com/apple/swift.git
synced 2025-12-21 12:14:44 +01:00
Add ID field to SourceKit's diagnostics
This commit is contained in:
@@ -310,6 +310,7 @@ entity ::=
|
||||
```
|
||||
diagnostic ::=
|
||||
{
|
||||
<key.id>: (string) // The internal ID of the diagnostic.
|
||||
<key.line>: (int64) // The line upon which the diagnostic was emitted.
|
||||
<key.column>: (int64) // The column upon which the diagnostic was emitted.
|
||||
<key.filepath>: (string) // The absolute path to the file that was being parsed
|
||||
|
||||
@@ -200,6 +200,7 @@ struct DiagnosticEntryInfoBase {
|
||||
std::string Text;
|
||||
};
|
||||
|
||||
std::string ID;
|
||||
std::string Description;
|
||||
unsigned Offset = 0;
|
||||
unsigned Line = 0;
|
||||
|
||||
@@ -2824,6 +2824,9 @@ static void fillDictionaryForDiagnosticInfo(
|
||||
static void fillDictionaryForDiagnosticInfoBase(
|
||||
ResponseBuilder::Dictionary Elem, const DiagnosticEntryInfoBase &Info) {
|
||||
|
||||
if (!Info.ID.empty())
|
||||
Elem.set(KeyID, Info.ID);
|
||||
|
||||
Elem.set(KeyDescription, Info.Description);
|
||||
if (Info.Line != 0) {
|
||||
Elem.set(KeyLine, Info.Line);
|
||||
|
||||
@@ -54,6 +54,7 @@ UID_KEYS = [
|
||||
KEY('EnableSyntaxMap', 'key.enablesyntaxmap'),
|
||||
KEY('SyntaxTreeTransferMode', 'key.syntaxtreetransfermode'),
|
||||
KEY('EnableStructure', 'key.enablesubstructure'),
|
||||
KEY('ID', 'key.id'),
|
||||
KEY('Description', 'key.description'),
|
||||
KEY('TypeName', 'key.typename'),
|
||||
KEY('RuntimeName', 'key.runtime_name'),
|
||||
|
||||
Reference in New Issue
Block a user