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

Ability to toggle coverage on or off #10

Open
kenhowardpdx opened this issue Aug 3, 2021 · 1 comment
Open

Ability to toggle coverage on or off #10

kenhowardpdx opened this issue Aug 3, 2021 · 1 comment
Labels

Comments

@kenhowardpdx
Copy link

kenhowardpdx commented Aug 3, 2021

I'd like the ability to toggle code coverage on and off. I've tried the following but unable to make this work:

autocmd FileType typescriptreact noremap <leader>gc :call ToggleCoverage()<return>
function! ToggleCoverage() abort
  if g:coverage_enabled
    let g:coverage_enabled = 0
    let g:coverage_show_covered = 0
    let g:coverage_show_uncovered = 0
  else
    let g:coverage_enabled = 1
    let g:coverage_show_covered = 1
    let g:coverage_show_uncovered = 1
  endif
  call coverage#start()
endfunction

let g:coverage_json_report_path = 'coverage/coverage-final.json'
let g:coverage_enabled = 0
let g:coverage_show_covered = 0
let g:coverage_show_uncovered = 0

I thought maybe :Coverage would do the toggle but it only starts it but doesn't stop it.

Any help would be appreciated. Hopefully this isn't a feature request.

@ruanyl
Copy link
Owner

ruanyl commented Aug 8, 2021

@kenhowardpdx Unfortunately, this feature hasn't been implemented.

@ruanyl ruanyl added the feature label Aug 8, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants