Open Guymestef opened 6 years ago
@Guymestef coverage-gutters seems to work perfectly well with this extension installed. I don't see how this extension could integrate with coverage-gutters as coverage-gutters is driven from your Jest config producing an lcov.info file.
Since vscode-jest has a feature to display coverage, it was more a question about having something as good as coverage-gutters than an integration. I found out coverage-gutters, because for me the actual vscode-jest coverage display is too obtrusive by using a background color on the whole line, and so I looked to have another way to display it. But I think the best would be to have this out of the box when using vscode-jest, rather than installing another plugin.
The ground work is there for us to choose code coverage formatters but we only have the default right now and no setting to choose between them. If you'd like to create a "coverage formatter" that integrates with coverage-gutters I'm happy to help with the PR. The formatter should extend the AbtractFormatter
in src/Coverage/Formatters and define the format
and clear
methods. If coverage-gutters has an API or commands to work with then it should be relatively straight forward.
I looked at the DefaultFormatter and at how coverage-gutters is doing the job. It's just a matter of options passed to createTextEditorDecorationType and a filter to get partially covered branches. It should be easily done thanks to the AbtractFormatter 👍
I'll try to do a PR when I'll find some time to work on it
I've created a PR as a first version of a GutterFormatter
Is this still a work-in-progress? I tried enabling GutterFormatter
and it changed the color of the highlights (actually making the code pretty hard to read) but did not put anything in the gutter.
@Guymestef have you had any time to improve the coverage gutters to actually be gutters?
I've made some improvements with this PR:
For the gutter images, I think it's currently not working because the images are not embedded with the extension. Anyone know how to include them? I moved them inside the images folder in case it's just a convention to put them there. But maybe we need to add a copy assets task to the pre-publish task?
At least with the settings, we should be able to use local images as a workaround...
What's the state of this? I tried enabling GutterFormatter but did not get any highlighting in the gutter
It should be nice to have display options like the ones offered by coverage-gutters
Maybe an integration with that plugin can be made rather than doing the same work?