diff options
| author | Kiyan Yazdani <yazdani.kiyan@protonmail.com> | 2020-04-21 18:26:07 +0200 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2020-04-21 18:26:07 +0200 |
| commit | b72559f9c2d87a90dbe8417276571c953b7b5292 (patch) | |
| tree | 916f722c69f23c85247b65528a74ff9c17382f87 /lua/nvim-treesitter/locals.lua | |
| parent | 8b01b9caee849253713adbdf156a4dac843349a4 (diff) | |
| parent | 698453e50ca1341245ff6c3f5303991a6f919342 (diff) | |
Merge pull request #12 from vigoux/checkhealth
feat: checkhealth
Diffstat (limited to 'lua/nvim-treesitter/locals.lua')
| -rw-r--r-- | lua/nvim-treesitter/locals.lua | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/lua/nvim-treesitter/locals.lua b/lua/nvim-treesitter/locals.lua index 808b0f3f..388c7e48 100644 --- a/lua/nvim-treesitter/locals.lua +++ b/lua/nvim-treesitter/locals.lua @@ -10,6 +10,22 @@ local M = { locals={} } +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, "locals") then + health_warn("No `locals.scm` query found for " .. lang, { + "Open an issue at https://github.com/nvim-treesitter/nvim-treesitter" + }) + else + health_ok("`locals.scm` found.") + end +end + function M.collect_locals(bufnr) local ft = api.nvim_buf_get_option(bufnr, "ft") if not ft then return end |
