add index and endIndex to JSON formats

This commit is contained in:
WebFreak001 2023-06-29 16:45:11 +02:00 committed by Jan Jurzitza
parent b115a6333a
commit 146fec75d8
2 changed files with 6 additions and 0 deletions

View File

@ -157,8 +157,10 @@ void writeJSON(Message message)
writeln(` "fileName": "`, message.fileName.replace("\\", "\\\\").replace(`"`, `\"`), `",`);
writeln(` "line": `, message.startLine, `,`);
writeln(` "column": `, message.startColumn, `,`);
writeln(` "index": `, message.startIndex, `,`);
writeln(` "endLine": `, message.endLine, `,`);
writeln(` "endColumn": `, message.endColumn, `,`);
writeln(` "endIndex": `, message.endIndex, `,`);
writeln(` "message": "`, message.message.replace("\\", "\\\\").replace(`"`, `\"`), `",`);
if (message.supplemental.length)
{

View File

@ -61,8 +61,10 @@ class DScannerJsonReporter
"fileName": JSONValue(issue.message.fileName),
"line": JSONValue(issue.message.startLine),
"column": JSONValue(issue.message.startColumn),
"index": JSONValue(issue.message.startIndex),
"endLine": JSONValue(issue.message.endLine),
"endColumn": JSONValue(issue.message.endColumn),
"endIndex": JSONValue(issue.message.endIndex),
"message": JSONValue(issue.message.message),
"type": JSONValue(issue.type),
"supplemental": JSONValue(
@ -71,8 +73,10 @@ class DScannerJsonReporter
"fileName": JSONValue(a.fileName),
"line": JSONValue(a.startLine),
"column": JSONValue(a.startColumn),
"index": JSONValue(a.startIndex),
"endLine": JSONValue(a.endLine),
"endColumn": JSONValue(a.endColumn),
"endIndex": JSONValue(a.endIndex),
"message": JSONValue(a.message),
])
).array