ryanluker / vscode-coverage-gutters

Display test coverage generated by lcov and xml - works with many languages
https://marketplace.visualstudio.com/items?itemName=ryanluker.vscode-coverage-gutters
MIT License
460 stars 88 forks source link

Address #364: catch errors per-section #365

Closed cceckman closed 2 years ago

cceckman commented 2 years ago

In #364, I accidentally produced a file that (apparently) has empty section filenames, as understood by the extension. This lead to an undefined property access (split) when trying to work with the file name; that exception propagated all the way up the rendering stack, resulting in no coverage being displayed.

With this change, if we encounter an error in checkSection, we just return false - if it's an erroneous section, it doesn't apply to the current file. (This is especially true if there is no section.file property!)

This way, we still show coverage wherever we can.

cceckman commented 2 years ago

Thanks for the comments - glad I wasn't too far off base!