vscode-coverage-gutters icon indicating copy to clipboard operation
vscode-coverage-gutters copied to clipboard

Watch for other Events to Load Coverage

Open celestialorb opened this issue 1 year ago • 2 comments

Is your feature request related to a problem? Please describe.

I have an issue in that my organization uses Bazel and I absolutely cannot figure out a way to get the extension (via VSCode's filesystem watcher) to trigger a reload of the coverage report aside from copying the coverage report out of the Bazel and into a file in the workspace's directory. It doesn't seem to follow symlinks or receive the events no matter what combination of files.watcher(Exclude|Include) I try.

As a result I'd like to suggest the ability to reload the coverage data on other events, such as focusing back into the editor, or periodically (i.e. on a timer event). These additional events could be disabled by default, but it would be super useful for situations like mine where I simply can't figure out why VSCode isn't triggering/detecting the change of a symlinked file outside of the workspace directory.

Describe the solution you'd like

I'd like the ability to configure additional events that would trigger reloading of the coverage file(s). Some additional event types could be:

  1. focus of a source code file in the editor
  2. periodically, on a configurable timer

Describe alternatives you've considered

I've now spent hours trying to track down and debug why the VSCode filesystem watcher isn't triggering/detecting when my coverage report has changed, but it's likely something to do with the fact that the report lives within a directory that is symlinked into the workspace root, or with the way that Bazel creates the coverage report.

In my case my coverage reports are relatively small and there's only one report file for the workspace so loading it periodically (say, every one to five seconds) shouldn't be a performance hit and it will provide a workaround until someone can sort out why Bazel's coverage report doesn't seem to trigger reloads when it is rewritten. Manually reloading with Coverage Gutters: Display Coverage works just fine.

Additional context None.

celestialorb avatar Nov 01 '24 21:11 celestialorb

@celestialorb Thanks for the issue, makes sense to include another method of reloading the coverage if the regular file watcher isn't working 🤔. I can maybe tinker a bit and see if the suggestions from https://github.com/ryanluker/vscode-coverage-gutters/issues/418#issuecomment-1649153739 could be an option as well. Your solution of having a configurable timer might be a good fallback too though!

ryanluker avatar Nov 17 '24 18:11 ryanluker

@celestialorb can you try following the suggestion listed here https://code.visualstudio.com/updates/v1_61#_file-watching-changes?

mattseddon avatar Aug 01 '25 06:08 mattseddon