diff options
| author | Thomas Vigouroux <tomvig38@gmail.com> | 2020-04-26 09:29:52 +0200 |
|---|---|---|
| committer | Thomas Vigouroux <tomvig38@gmail.com> | 2020-04-26 09:29:52 +0200 |
| commit | 4d4e7d8a8c03c958e8badf7e3ee34e444ddcb4e0 (patch) | |
| tree | e36e0a1d7dc31208501132908a9c4f6eb105572f /lua/nvim-treesitter/highlight.lua | |
| parent | f8b39e1d3ad36c2e5d6eb6f51983275ecc9145f0 (diff) | |
health: add highlight to healthchecks
Diffstat (limited to 'lua/nvim-treesitter/highlight.lua')
| -rw-r--r-- | lua/nvim-treesitter/highlight.lua | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/lua/nvim-treesitter/highlight.lua b/lua/nvim-treesitter/highlight.lua index 65ab48dc..04f21eb1 100644 --- a/lua/nvim-treesitter/highlight.lua +++ b/lua/nvim-treesitter/highlight.lua @@ -25,4 +25,20 @@ function M.detach(bufnr) api.nvim_buf_set_option(buf, 'syntax', 'on') end +function M.checkhealth(lang) + local health_start = vim.fn["health#report_start"] + local health_ok = vim.fn['health#report_ok'] + local health_info = vim.fn['health#report_info'] + local health_warn = vim.fn['health#report_warn'] + local health_error = vim.fn['health#report_error'] + + if not queries.get_query(lang, "highlights") then + health_warn("No `highlights.scm` query found for " .. lang, { + "Open an issue at https://github.com/nvim-treesitter/nvim-treesitter" + }) + else + health_ok("`highlights.scm` found.") + end +end + return M |
