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

Preview coverage report feature doesn't show anything #381

Closed KShivendu closed 1 year ago

KShivendu commented 1 year ago

Describe the bug

Unable to use the "Preview coverage report" feature. It doesn't show anything despite the fact that coverage/htmlcov/index.html exists and contains relevant HTML generated with coverage cli.

To Reproduce Steps to reproduce the behaviour:

  1. Generate coverage report at coverage/htmlcov/index.html
  2. Open command pallete
  3. Select 'Preview coverage report'
  4. Notice that nothing happens

Expected behaviour Probably an in-editor browser preview of index.html

Desktop (please complete the following information):

Additional context

I have 0.4.3 of ms-vscode.live-server (i.e. > 0.2.12)


^^^ Original ticket @ryanluker's investigation below

Bug Report

Looks like the 0.4.x release broke something with the way the extension integrates with the live server functionality.

Temporary Fix

Switching the extension to a version in the 0.2.x range will fix the issue for now.

ryanluker commented 1 year ago

@KShivendu Thanks for the ticket! Looks like there is an issue with the newest live preview extension🤔. See the second image on how to downgrade for now. image image

junalmeida commented 1 year ago

@ryanluker Have you tried changing this method: https://github.com/ryanluker/vscode-coverage-gutters/blob/1b7414f85ec133b87fe225d6d1ed6c815dd57382/src/coverage-system/coverage.ts#L25

To return an instance of vscode.URI instead of string? And then pass it to the live preview? It seems they have changed it from string to an instace of vscode.URI on latest versions.

ryanluker commented 1 year ago

@junalmeida Good call out, that is probably what caused the issue with the latest version... should be an easy fix then.

ryanluker commented 1 year ago

@kaltepeter Thanks for the fix on this 👍🏻.