# Code coverage with Coverage.jl in vscode

**URL:** <https://discourse.julialang.org/t/code-coverage-with-coverage-jl-in-vscode/65438>\
**Category:** New to Julia\
**Tags:** question\
**Created:** [July 28, 2021, 1:53pm UTC](https://discourse.julialang.org/t/code-coverage-with-coverage-jl-in-vscode/65438 "2021-07-28T13:53:55Z")\
**Posts on this page:** 1\
**Showing post:** 3

<div class="post-metadata">

**Author:** ![goretkin](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/goretkin/32/167_2.png) [@goretkin](https://discourse.julialang.org/u/goretkin)\
**Post date:** [June 29, 2022, 7:11pm UTC](https://discourse.julialang.org/t/code-coverage-with-coverage-jl-in-vscode/65438/3 "2022-06-29T19:11:14Z")

</div>

I just tried `Coverage.LCOV.write(filepath, coverage)` does not work. Here is the complete workflow that worked for me

# Julia line coverage information in VS Code

First generate `.cov` files:

```julia
using Pkg
Pkg.test("MyPackage"; coverage=true)

```

Then

```julia
using Coverage
coverage = process_folder()
open("lcov.info", "w") do io
    LCOV.write(io, coverage)
end;

```

Finally, open a source file in VS Code and run the command “Coverage Gutters: Display Coverage” in the VS Code Command Pallet.

---

_[View the full topic](https://discourse.julialang.org/t/code-coverage-with-coverage-jl-in-vscode/65438)._
