vscode-code-review
vscode-code-review copied to clipboard
[bug] Incorrect ordering for code excerpts in HTML report
🐞 Bug report
Description
When I use the alt and click feature to select multiple ranges of code, I expected that the report would display them in order of line number, not the order that they are selected. It seems like they are displaying in the order selected.
Reproduction
- Create a code file with multiple lines in it.
- Select code on a higher line number
- Select code on a lower line number
- Generate an HTML report
Example output:
Error message
None
I agree, the selections should be ordered in the Output. by the first selected line in each range. I think it's possible to mark e.g. line 20-21 and line 18-25 (This contains the firstselection). In such cases I would expect to show:
- Line 18-25
- Line 20-21 (as the first line is greater compared to 18)
You may want to double check and see, I thought I remember it actually combining two selections into one if they overlap (could be wrong though!). I generally agree about your ordering rules. I figure if the ordering rules in a code excerpt are the same as the rules which order the code excerpts in the report, it promotes sensible consistency.