From 966096b502b72a6a81991d5dcd59b84ad33ed499 Mon Sep 17 00:00:00 2001 From: Stephan Seitz Date: Mon, 22 Mar 2021 12:33:10 +0100 Subject: fix(CI): ensure parsers that don't require tree-sitter CLI are installed --- scripts/check-queries.lua | 13 +++++++++++++ 1 file changed, 13 insertions(+) (limited to 'scripts') diff --git a/scripts/check-queries.lua b/scripts/check-queries.lua index c816c19b1..e89c92ca4 100755 --- a/scripts/check-queries.lua +++ b/scripts/check-queries.lua @@ -58,6 +58,19 @@ end local ok, err = pcall(do_check) + +for k, v in pairs(require 'nvim-treesitter.parsers'.get_parser_configs()) do + if not require 'nvim-treesitter.parsers'.has_parser(k) then + -- On CI all parsers that can be installed from C files should be installed + if vim.env.CI and not v.install_info.requires_generate_from_grammar then + print('Error: parser for '..k..' is not installed') + vim.cmd('cq') + else + print('Warning: parser for '..k..' is not installed') + end + end +end + if ok then print('Check successful!\n') vim.cmd('q') -- cgit v1.2.3-70-g09d2