-
Notifications
You must be signed in to change notification settings - Fork 90
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Cannot read properties of undefined (reading 'split') #364
Comments
Managed to get this running under the VS code debugger. This seems to be landing in this function. Stepping through, I see All that shakes out fine, oddly enough, for the first several iterations. Eventually, we hit an iteration where
Bumping back up the stack to Is the LCOV file ill-formed? (If so, I can take that up in Rust fora - I may not be putting it together properly!) On the |
In ryanluker#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 Thank your for submitting a ticket and the evaluation of the issue!
No worries on this front as even a ticket can be a good place for us to start looking at the issue 🤔.
I am glad you enjoy the extension and were able to get the local debugging working (you were on the right track with the url above).
You are correct here that the error is producing a state where the extension sees the whole coverage as invalid (thus the no coverage mention in the tooltip). Ideally it should log the "bad" section and move along with consuming all the other good sections that are valid lcov... 🤔 . I see you put up a PR as well so I can take a look there next! |
Address #364: catch errors per-section
I believe this has been fixed with #365 (Nice work there!). |
With this lcov.info.gz file (uncompressed) in my repository,
coverage-gutters
provides the following output in the VS Code "output" pane- some initial output elided:I'm afraid I don't have a minimal-viable-reproducing example, but any of the
lcov
files I've managed to get out of this repository have the same stack trace. (Private repository so far- sorry! I've been trying to get a minimal reproducible example but no such luck yet.)The
lcov.info
file above is generated from a Rust integration test binary (built with 1.60's new-C instr-coverage
flag), then running theprofraw
file throughllvm-profdata
andllvm-cov
. Same behavior with unit test binaries, though.I'm afraid I'm not super familiar with debugging VS Code extensions - any pointers to help get the relevant information for this? (I see these docs and may be able to make some time to give it a try.)
Thanks for this lovely extension!
What's the best way for me to get more debug info on this?
The text was updated successfully, but these errors were encountered: