google / vim-coverage

Apache License 2.0
101 stars 22 forks source link

Mechanism to invoke "bazel coverage" and show the results #42

Open dbarnett opened 3 years ago

dbarnett commented 3 years ago

For working on bazel projects, it would be great to have a simple way to show coverage results generated from bazel coverage (see https://docs.bazel.build/versions/master/command-line-reference.html#coverage and https://blog.bazel.build/2018/10/29/bazel-0.19.0.html#code-coverage).

A gcov coverage provider (#6) gets us part of the way there, but the wiring gets a little complicated for how to easily…

  1. Invoke the right bazel coverage command
  2. Clue vim-coverage in to where to find for the output files
  3. Show the coverage results on the buffer

@okkays

dbarnett commented 3 years ago

In general, I'd like vim-coverage to stay agnostic of the details about how to invoke different test tools that generate coverage, and focus on a great experience for being able to automatically pick up and show new coverage findings.

For "bazel coverage", let's focus the design around a good way for outside code to signal to the plugin "I have new coverage results, here's where to find them, please load them into vim". I'm going to suggest as a quick-and-dirty solution that looks something like:

call maktaba#plugin#Get('coverage').globals._lcov_temp_search_path = [ SOMEPATH ]
call coverage#Show('lcov')

and then work out a more intuitive interface later to handle passing that data through.