We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 970e407 commit 809b463Copy full SHA for 809b463
1 file changed
src/extension.ts
@@ -270,8 +270,9 @@ async function runCppcheckOnFileXML(
270
271
// Related Information
272
const relatedInfos: vscode.DiagnosticRelatedInformation[] = [];
273
- for (let i = 0; i < locations.length; i++) {
274
- const loc = locations[i].$;
+ for (let i = 1; i <= locations.length; i++) {
+ // Related information is ordered in reverse in XML object
275
+ const loc = locations[locations.length - i].$;
276
const msg = loc.info;
277
const lLine = Number(loc.line) - 1;
278
@@ -302,4 +303,4 @@ async function runCppcheckOnFileXML(
302
303
}
304
305
// This method is called when your extension is deactivated
-export function deactivate() {}
306
+export function deactivate() {}
0 commit comments