Plugin for Neovim's built-in LSP to display flow type coverage as diagnostics
Neovim 0.5+
flow-coverage supports all the usual plugin managers
Packer
require('packer').startup(function()
use 'stevearc/flow-coverage.nvim'
end)
Paq
require "paq" {
'stevearc/flow-coverage.nvim';
}
vim-plug
Plug 'stevearc/flow-coverage.nvim'
dein
call dein#add('stevearc/flow-coverage.nvim')
Pathogen
git clone --depth=1 https://github.com/stevearc/flow-coverage.nvim.git ~/.vim/bundle/
Neovim native package
git clone --depth=1 https://github.com/stevearc/flow-coverage.nvim.git \
"${XDG_DATA_HOME:-$HOME/.local/share}"/nvim/site/pack/flow-coverage/start/flow-coverage.nvim
Step one is to get Neovim LSP set up, which is beyond the scope of this guide. See nvim-lspconfig for instructions. You will need to use that plugin to set up the flow LSP, for example:
require('lspconfig').flow.setup{}
When the flow LSP client is configured and this plugin is installed, Neovim will automatically start showing uncovered lines using standard diagnostics display. Additionally, you can get the coverage percentage with:
require('flow').get_coverage_percent()
Variable | Type | Default | Description |
---|---|---|---|
g:flow_coverage_interval |
number | 5000 |
How often (in ms) to refresh the type coverage of a file. Set to 0 to disable. |