vscode-coverage-gutters: Unable to get coverage to display
I can’t get coverage-gutters to render the gutters. After having done some tracing, I think the issue is in/around renderer.findIntersect(), as it always return “”.
Information about my setup:
- VS Code: 1.23.0 (OSX 10.13.4)
- Coverage Gutters: 2.0.0
- python: 2.7.14
- python coverage: 4.5.1
- pytest: 3.5.1
- pytest-cov: 2.5.1
- I’m generating cov.xml via
pytest --cov=myprojectname --cov-report=xml:cov.xml
Snippet of cov.xml:
<coverage branch-rate="0" branches-covered="0" branches-valid="0" complexity="0" line-rate="0.7871" lines-covered="196" lines-valid="249" timestamp="1525805187668" version="4.5.1">
<!-- Generated by coverage.py: https://coverage.readthedocs.io -->
<!-- Based on https://raw.githubusercontent.com/cobertura/web/master/htdocs/xml/coverage-04.dtd -->
<sources>
<source>/Users/justfalter/code/myprojectname/myprojectname</source>
</sources>
<packages>
<package branch-rate="0" complexity="0" line-rate="0.7871" name=".">
<classes>
<class branch-rate="0" complexity="0" filename="messages.py" line-rate="0.9691" name="messages.py">
<methods/>
<lines>
<line hits="1" number="3"/>
<line hits="1" number="4"/>
<line hits="1" number="5"/>
<line hits="1" number="7"/>
</lines>
</class>
</classes>
</package>
</packages>
</coverage>
For example, findTopSectionForEditor calls findIntersect(base: editorFile, comparee: sectionFile):
- editorFile:
###users###justfalter###code###myprojectname###myprojectname###messages.py - sectionFile:
messages.py
subInt ends up being messages.py, here: https://github.com/ryanluker/vscode-coverage-gutters/blob/f06458d0ae307118fe6ea54e2efa187dc6bc08e7/src/renderer.ts#L140
But the function always seems to return “” here: https://github.com/ryanluker/vscode-coverage-gutters/blob/f06458d0ae307118fe6ea54e2efa187dc6bc08e7/src/renderer.ts#L142-L144
About this issue
- Original URL
- State: closed
- Created 6 years ago
- Reactions: 3
- Comments: 21 (16 by maintainers)
Commits related to this issue
- [#133] Remove ### detection on intersect prepares for new upstream version of cobertura that has filename fixes — committed to ryanluker/vscode-coverage-gutters by ryanluker 6 years ago
- [#133] Update xml parse to fix naming collisions — committed to ryanluker/vscode-coverage-gutters by ryanluker 6 years ago
@ryanluker You are correct.
lcov-parseis taking it’sfileattribute from lcov’sSFpart (SF:<absolute path to the source file>)The clean solution is to update
cobertura-parseand extend paths to absolute paths. But I also see benefits of adding switch in this project for allowing less strict path matching.Since I recently made small update in
cobertura-parseI will make PR with absolute paths update later today.