idanarye / vim-dutyl

Coordinate D tools to work together for you
http://www.vim.org/scripts/script.php?script_id=5003
79 stars 13 forks source link

Visual coverage analysis #27

Open andrewbenton opened 8 years ago

andrewbenton commented 8 years ago

I think an integration with DUB to run coverage analysis and display the results visually within vim would be very useful. Preferably it could co-exist with plugins such as vim-gitgutter and syntastic.

idanarye commented 8 years ago

Dutyl relies on the uniformity of dub describe to extract the paths for source files, imports and string imports. But doing coverage tests with DUB is not that uniform - you need to change the DUB file to add a configuration that does coverage tests, and it doesn't have a uniform default name.

So, I can't just run a DUB command and expect to get the coverage - not unless I edit the DUB file, which is not something I want to do from within Dutyl. I also don't want to run coverage analysis from Dutyl, since it's a very long operation and Dutyl doesn't have async facilities...

Dutyl, however, can provide the paths from DUB to other plugins. @joakim-brannstrom was working on doing so for syntactic almost a year ago. No idea if he is still interested in it though...

joakim-brannstrom commented 8 years ago

Hello,

yes, the natural progression after successfully integrating vim-dutyl with syntastic. I just never got around to finish the PR's to syntastic and vim-dutyl. "Works! Time to use it!"

My work can be found at: https://github.com/joakim-brannstrom/syntastic/tree/dmd_cov_support Has to be used together with my syntastic branch of vim-dutyl: https://github.com/joakim-brannstrom/vim-dutyl/tree/syntastic-cov-int

Does it do what you need?

andrewbenton commented 8 years ago

I think that at least for files with a module statement, it should be possible to pair the coverage tests with source files one to one. The output format for the coverage seems to be <source-directory>-<module>.lst when run with dub test --coverage. I don't know if the coverage tests can be directed to target only affected files, so the async thing might be an issue for large projects. How difficult is it to make use of neovim if it exists?

andrewbenton commented 8 years ago

Hi @joakim-brannstrom, I'll check it out! Thanks for the work!