diff options
Diffstat (limited to 'lua/nvim-treesitter/utils.lua')
| -rw-r--r-- | lua/nvim-treesitter/utils.lua | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/lua/nvim-treesitter/utils.lua b/lua/nvim-treesitter/utils.lua index e6a6358a..0e836404 100644 --- a/lua/nvim-treesitter/utils.lua +++ b/lua/nvim-treesitter/utils.lua @@ -193,4 +193,13 @@ function M.to_func(a) return type(a) == "function" and a or M.constant(a) end +function M.ts_cli_version() + if fn.executable "tree-sitter" == 1 then + local handle = io.popen "tree-sitter -V" + local result = handle:read "*a" + handle:close() + return vim.split(result, "\n")[1]:match "[^tree%psitter ].*" + end +end + return M |
