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

Start watching on workspace open

Open craigbrett17 opened this issue 6 years ago • 24 comments

I have a setup for a Python project where I'm using coverage gutters + save and run to get a fairly automated unit test coverage experience for Python. It's helping a lot. One of the last bits i need to automate though is watching the cov.xml file when I open my folder.

I'd like a settings.json setting to have coverage gutters start watching on workspace start up, please.

This is a quality of life thing more than anything. I'm loving the tool and loving the setup I seem to have going here, this would round it off nicely.

craigbrett17 avatar Oct 01 '19 10:10 craigbrett17

@craigbrett17 thanks for the feature suggestion! Just so I understand completely, you are saying that the extension should automatically "try" to start watching when a workspace is opened. Where "try" would mean looking for coverage files and if none are found it would not activate coverage watch, while if some coverage is found it would start watching?

ryanluker avatar Oct 06 '19 21:10 ryanluker

@ryanluker: I think you've hit it on the head. Sort of an on activation trigger (at least I think that's what the VS extension event is). I know it only really saves me doing one shortcut key, but it makes it feel more embedded then. Obviously best to keep it optional, as not everyone might want this behaviour, but I'd be keeping it on myself.

craigbrett17 avatar Oct 08 '19 08:10 craigbrett17

I like the idea :) I was searching for that. In my case, I use this extension for C/C++ projects with gcovr.

~Can be an issue to check all directories for the coverage file - all the time - if there is no one yet.~ ~Could be maybe solved by listening for directory change, then if found - save the path to it and listen for the specific file change in a specific workspace. In that way, we could see coverage in "real-time" :D~ ~Then just listening on events like file opened, tab switched to fetch the coverage.~

~I'm not a guy sitting deeply in VSCode extension development :)~

~WAIT.~

There is something like Coverage Gutters: Watch option which can be activated through ?"omnibox"? that SHIFT-CTRL-P thingy What about adding it to the configuration like coverage-gutters.watch ?

TheAifam5 avatar Oct 09 '19 22:10 TheAifam5

@TheAifam5 you can use the command palette (maybe that's the "omnibox" thing you mentioned?). I have attached a screen share showing that but the other feature that was discussed here will be added in version 3. Screencast from 2019-10-14 02:25:09 PM.zip

ryanluker avatar Oct 14 '19 21:10 ryanluker

+1 from me for this being a thing.

DevilXD avatar Apr 08 '21 15:04 DevilXD

@DevilXD Thanks for the +1, helps me understand how to prioritize the feature for the next release.

ryanluker avatar Apr 11 '21 15:04 ryanluker

Just to add to this, I notice that I must start Watch every time I start Visual Studio Code. It really would be nice if Watch would attempt to start automatically. In my opinion, I would rather it runs all the time, and waits until it finds an lcov..info file (even if one doesn't exist already). This will just make it transparent and active all the time which is what I would personally love.

I'm not sure if others agree with this though 😄

fgimian avatar Jun 19 '21 12:06 fgimian

That's pretty much what this whole issue is about. If the file exists - start watching automatically. If it doesn't, do nothing.

@ryanluker Is there any ETA on when this is going to be released, by chance?

DevilXD avatar Jun 19 '21 14:06 DevilXD

@fgimian @DevilXD Thanks for the input and bringing this back up to my attention! Currently it is scheduled for the next major release 3.0.0.

Although, seeming it could be added as a opt in feature it can go in any upcoming minor release if someone finds time to work on it 😁 . If we wanted it to be on by default then we would need to include it in 3.0.0 probably as that might require folks to adjust their setups 🤔 .

ryanluker avatar Jun 19 '21 16:06 ryanluker

I'd like to, but unfortunately I'm not familiar with Typescript / JS / whatever this is written in, so can't really help myself. Maybe someone else can.

I'm fine with it being an opt-in feature, as long as it becomes a thing eventually.

DevilXD avatar Jun 19 '21 20:06 DevilXD

@DevilXD No need to worry about doing the work yourself, I am just glad people contribute by submitting issues and feature requests! We will get to this eventually 🤔 .

ryanluker avatar Jun 20 '21 02:06 ryanluker

+1

srfrnk avatar Feb 26 '22 18:02 srfrnk

+1

Fran314 avatar Aug 25 '22 01:08 Fran314

any further updates to this, or a possible date for v3?

thanks

davidwallis avatar Oct 11 '22 12:10 davidwallis

Thanks for the +1's and comments @srfrnk , @Fran314 and @davidwallis3101.

No plans for v3 yet, the project hasn't gotten a lot of contributions lately from myself or other folks in the repo, but this ticket can be pushed up into 2.11 or other pre v3 releases if there is interest or someone champions doing the work.

ryanluker avatar Oct 15 '22 17:10 ryanluker

+1 would really love a way to set in the configuration for it to just always be on and watching.

grantwest avatar Mar 31 '23 20:03 grantwest

+1 would really love a way to set in the configuration for it to just always be on and watching.

Thanks for the ping @grantwest hopefully we can get to this soon!

ryanluker avatar Apr 02 '23 19:04 ryanluker

I think that the situation is even bit worse as settings do not seem to be configurable at workspace level, see popup from vscode while editing in-repo .vscode/settings.json file:

I suspect that this is related to https://github.com/microsoft/vscode/issues/82117 which also means that this extension might not be able to deal with multiple workspaces, something extremely common these days, as is it quite uncommon to have to open a single project at a time. -- Filed bug for that one at https://github.com/ryanluker/vscode-coverage-gutters/issues/408

ssbarnea avatar May 17 '23 09:05 ssbarnea

I think that the situation is even bit worse as settings do not seem to be configurable at workspace level, see popup from vscode while editing in-repo .vscode/settings.json file:

I suspect that this is related to microsoft/vscode#82117 which also means that this extension might not be able to deal with multiple workspaces, something extremely common these days, as is it quite uncommon to have to open a single project at a time. -- Filed bug for that one at #408

@ssbarnea Thanks for the ping! Multi workspace support was added a very long time ago within this extension, so it might have issues now with the latest version of VS Code. I vaguely remember adding tests for this, but I can double-check to confirm that the examples folder is still openable in a workspace.

If you haven't seen it already, maybe take a look at the workspaces config file below that is in the examples folder 🤔. https://github.com/ryanluker/vscode-coverage-gutters/blob/master/example/example.code-workspace

ryanluker avatar May 22 '23 16:05 ryanluker

+1 for this!

m-roberts avatar Jun 01 '23 15:06 m-roberts

The option for automatically watching on workspace open would be very nice. However, clicking the coverage icon inside the status bar is also easy. But you know, we as developers always want minimal effort to be productive :)

HelmerBarcos avatar Jan 20 '24 12:01 HelmerBarcos

@m-roberts @HelmerBarcos Thanks for the input! Hopefully myself or another contributor can get to this soon.

ryanluker avatar Feb 25 '24 19:02 ryanluker