Closed f1ames closed 1 year ago
Hmmm, looks like it might be OS specific issue 🤔
For me (Windows, WSL) it looks the same as in the cloud (which seems correct):
@WitoDelnat did you do any actions in between or it was off from the very beginning? Maybe you can share your SARIF result file so I can see if offsets are correct (meaning if it's on @monokle/validation
side or SARIF ext side).
This happens when file is edited - on edit highlight stays in place, not being moved with old content when something is added/removed.
When running Validate
command manually, it will be corrected. However, when automatic validation runs on file save it will stay as is. I suspect this is due to a difference how we interact with SARIF API in those two cases.
It seems the issue is in @monokle/validation
library, where start/end line are calculated incorrectly. I'm working on isolating this particular case to find the root cause why it happens.
Fixed in https://github.com/kubeshop/vscode-monokle/commit/9342085b9d468a9c05ed01c4463f7b0f2e2baac1.
It turned out, that this issue is caused by @monokle/validator
parser cache. The parser caches resources content by resource.id
where id is generated based on only few resource properties. Depending on what was modified in the file the cache may not be cleared.
I still think the cache is quite useful, making validation really efficient (especially with multiple resources), so I implemented mechanism to only clear cache of a particular resource when it is modified.
Some highlights seems to be a bit off (see screenshot below). Tested with https://github.com/kubeshop/monokle-demo.
Might be an issue with
@monokle/validation
.