Skip to content

Commit 8cc2f59

Browse files
authored
Fix highlight region end column calculation (#1210)
1 parent 46a1dd5 commit 8cc2f59

2 files changed

Lines changed: 5 additions & 2 deletions

File tree

extensions/ql-vscode/src/remote-queries/sarif-processing.ts

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -169,7 +169,10 @@ function getHighlightedRegion(region: sarif.Region): HighlightedRegion {
169169
startLine,
170170
startColumn,
171171
endLine,
172-
endColumn
172+
173+
// parseSarifRegion currently shifts the end column by 1 to account
174+
// for the way vscode counts columns so we need to shift it back.
175+
endColumn: endColumn + 1
173176
};
174177
}
175178

extensions/ql-vscode/test/pure-tests/sarif-processing.test.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -579,7 +579,7 @@ describe('SARIF processing', () => {
579579
startLine: 35,
580580
startColumn: 20,
581581
endLine: 35,
582-
endColumn: 59
582+
endColumn: 60
583583
}
584584
});
585585
expect(message.tokens[2].t).to.equal('text');

0 commit comments

Comments
 (0)