summaryrefslogtreecommitdiff
path: root/lua/nvim-treesitter/locals.lua
diff options
context:
space:
mode:
authorkiyan42 <yazdani.kiyan@protonmail.com>2020-04-20 22:33:13 +0200
committerThomas Vigouroux <tomvig38@gmail.com>2020-04-21 13:38:16 +0200
commit698453e50ca1341245ff6c3f5303991a6f919342 (patch)
tree916f722c69f23c85247b65528a74ff9c17382f87 /lua/nvim-treesitter/locals.lua
parent8b01b9caee849253713adbdf156a4dac843349a4 (diff)
feat: add checkhealth
Diffstat (limited to 'lua/nvim-treesitter/locals.lua')
-rw-r--r--lua/nvim-treesitter/locals.lua16
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