trailofbits / vscode-weaudit

Create code bookmarks and code highlights with a click.
https://marketplace.visualstudio.com/items?itemName=trailofbits.weaudit
GNU General Public License v3.0
169 stars 16 forks source link

Findings and notes do not "follow" code. #15

Open paul-uz opened 6 months ago

paul-uz commented 6 months ago

I added a finding and a note to some code, but afterwards, I modified the code, adding some new functions. The finding and note keep their original line numbers, meaning they no longer relate to the original code I highlighted.

fcasal commented 6 months ago

Hello @paul-uz, what you describe is known behavior as weAudit is unaware of the contents of files, and only knows about line regions in files.

You probably have noticed that, despite this, the code region will move when you write code around a highlighted code region, giving the impression that it is computing the correct regions. However, there is no way of tracking these events to correctly update the code region (see e.g., https://github.com/Microsoft/vscode/issues/48364). There seem to be some cases where people manually track and compute these changes, but we decided not to try implement this feature for the time being.

paul-uz commented 6 months ago

Could you at least make it easier to change the line numbers in the UI?

If I could select a note and drag it up and down, and expand or shrink it, without the UI, that would at least be acceptable for now.

n0kto commented 4 months ago

Completly agree on this one! If this is not possible to keep track of new lines, a UI drag and drop could be a useful mitigation.