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

Can't find lcov.info if it's excluded from the VSCode project #66

Closed keithkml closed 7 years ago

keithkml commented 7 years ago

Great plugin – now that I got it working!

I spent the first 10 minutes fighting with it - reloading, reinstalling, changing config settings.

Then I realized the problem might be that the lcov.info is in an excluded path. (I exclude my coverage folder so the hundreds of generated HTML files – one per source file – don't clog up my search results)

{
    "files.exclude": {
        "**/.git": true,
        "**/.svn": true,
        "**/.hg": true,
        "**/CVS": true,
        "**/.DS_Store": true,
        "dist-*/**": true,
        "coverage/**": true
    }
}

I've found a workaround:

        "coverage/{server,shared,client,lcov-report}/**": true

But it would be nice if I didn't have to do this!

ryanluker commented 7 years ago

Thanks for the issue keith, I have had other coworkers give me similar feedback around excluding files and having the lcov not be detected. I believe this is related to the findFiles api vscode exposes for extension development.

https://code.visualstudio.com/docs/extensionAPI/vscode-api

Find files in the workspace.

sample - findFiles('**∕*.js', '**∕node_modules∕**', 10)
Parameter   Description
include: string 
A glob pattern that defines the files to search for.

exclude?: string    
A glob pattern that defines files and folders to exclude.

maxResults?: number 
An upper-bound for the result.

token?: CancellationToken   
A token that can be used to signal cancellation to the underlying search engine.

Returns Description
Thenable<Uri[]> 
A thenable that resolves to an array of resource identifiers.

My implementation: https://github.com/ryanluker/vscode-coverage-gutters/blob/master/src/lcov.ts#L22

I am thinking a work around for this would be to try to do a raw node file system search (slower, but wouldnt use vscode's exclude settings) in the case where the findFiles fails to locate. Although, maybe this could even be the default option if I find the performance hit isnt too bad... Anyways thanks again for the issue, I will try to get it into the 1.0 release. I hope you continue to enjoy the plugin.

ryanluker commented 7 years ago

@keithkml the glob solution in #67 will go out in the version 1.0.0 release (hopefully within a week) thanks again for submitting an issue about this 😄

keithkml commented 7 years ago

Yay thanks!!! Love the plugin!