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

Ver 2.1.0 is trying to display coverage for an incorrect file #155

Closed Shtsh closed 6 years ago

Shtsh commented 6 years ago

Update 2.0.1 -> 2.1.0 breaks plugin on the same python project and the same opened file (std2prom/plugins/baseplugin.py).

Project root is: /Users/shtsh/Work/np_scripts/std2prom/ File path is: /Users/shtsh/Work/np_scripts/std2prom/std2prom/plugins/baseplugin.py Coverage file path: /Users/shtsh/Work/np_scripts/std2prom/coverage.xml OS: macOS 10.13.6 VS Code version: both 1.26.0-insider and current stable.

version 2.0.1 works as expected

[1533241913863][coverageservice]: INITIALIZING
[1533241932015][coverageservice]: LOADING
[1533241932040][coverageservice]: Loading 1 file(s)
[1533241932061][coverageservice]: Caching 13 coverage(s)
[1533241932061][coverageservice]: READY
[1533241932061][coverageservice]: RENDERING
[1533241932062][renderer][section file path]: plugins/baseplugin.py [exactness score]: 27.380952380952383
[1533241932064][coverageservice]: READY

2.1.0 detects selected file incorrectly

[1533241827684][coverageservice]: INITIALIZING
[1533241844099][coverageservice]: LOADING
[1533241844127][coverageservice]: Loading 1 file(s)
[1533241844147][coverageservice]: Caching 13 coverage(s)
[1533241844147][coverageservice]: READY
[1533241844148][coverageservice]: RENDERING
[1533241844149][renderer][section file path]: /Users/shtsh/Work/np_scripts/std2prom/std2prom/__init__.py
[1533241844149][coverageservice]: READY
ryanluker commented 6 years ago

@Shtsh thanks for submitting an issue. This looks similar to #156 so I will dig into both at the same time. For your coverage.xml file do you know if you used cobertura or clover xml for it?

Shtsh commented 6 years ago

Seems, it's based on cobertura Here it is: https://pastebin.com/VTwrjcik

ryanluker commented 6 years ago

@Shtsh Figured out the issue with this one, when you have the root project name duplicated as a folder it causes issues with the naive string split I was using. In the meantime, until I get a fix together, you should be able to open the folder above your project as a workspace and have it work fine. problem1

ryanluker commented 6 years ago

@Shtsh fixed this in #159 and going to merge and do a small bugfix release today or tomorrow sometime (2.1.1).

diegoveloper commented 6 years ago

Great Job! . Do you know when 2.1.1 will be released? I can't see the Flutter coverage , it was working the last month.

ryanluker commented 6 years ago

@diegoveloper going to do a release later today (PST) if I get a chance!

ryanluker commented 6 years ago

@diegoveloper @Shtsh 2.1.1 has been released. we can reopen this ticket (or @diegoveloper you can open a flutter specific issue) if it is still an issue.

Shtsh commented 6 years ago

Thank you, works well for me