d-koppenhagen / vscode-code-review

Create a code review with all your comments in one file
https://marketplace.visualstudio.com/items?itemName=d-koppenhagen.vscode-code-review
MIT License
68 stars 35 forks source link

[bug] Incorrect ordering for code excerpts in HTML report #117

Open bluenick2k17 opened 2 years ago

bluenick2k17 commented 2 years ago

🐞 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

  1. Create a code file with multiple lines in it.
  2. Select code on a higher line number
  3. Select code on a lower line number
  4. Generate an HTML report

Example output: image

Error message


None
d-koppenhagen commented 2 years ago

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:

  1. Line 18-25
  2. Line 20-21 (as the first line is greater compared to 18)
bluenick2k17 commented 2 years ago

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.