Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Watch for other Events to Load Coverage #457

Open
celestialorb opened this issue Nov 1, 2024 · 1 comment
Open

Watch for other Events to Load Coverage #457

celestialorb opened this issue Nov 1, 2024 · 1 comment
Milestone

Comments

@celestialorb
Copy link

celestialorb commented Nov 1, 2024

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.

@ryanluker
Copy link
Owner

@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 #418 (comment) could be an option as well. Your solution of having a configurable timer might be a good fallback too though!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants