From 7760f08658ca22386d2d592340717d0143a67d03 Mon Sep 17 00:00:00 2001 From: bitcoder Date: Fri, 5 Mar 2021 21:47:41 +0800 Subject: add treesitter version in checkhealth --- lua/nvim-treesitter/health.lua | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 'lua') diff --git a/lua/nvim-treesitter/health.lua b/lua/nvim-treesitter/health.lua index 14dd93a71..b9a83725d 100644 --- a/lua/nvim-treesitter/health.lua +++ b/lua/nvim-treesitter/health.lua @@ -12,6 +12,16 @@ local M = {} local function install_health() health_start('Installation') + if fn.executable('tree-sitter') == 0 then + health_error('`tree-sitter` executable not found') + else + local handle = io.popen('tree-sitter -V') + local result = handle:read("*a") + handle:close() + local version = vim.split(result,'\n')[1]:match('[^tree%psitter].*') + health_ok('`tree-sitter` version '..version) + end + if fn.executable('git') == 0 then health_error('`git` executable not found.', { 'Install it with your package manager.', -- cgit v1.2.3-70-g09d2