aboutsummaryrefslogtreecommitdiffstats
path: root/scripts/check-queries.lua
diff options
context:
space:
mode:
authorStephan Seitz <stephan.seitz@fau.de>2021-03-22 12:33:10 +0100
committerThomas Vigouroux <tomvig38@gmail.com>2021-04-22 15:38:18 +0200
commit966096b502b72a6a81991d5dcd59b84ad33ed499 (patch)
treee355550fd8b0c61eeb4297aab6abbf214632928d /scripts/check-queries.lua
parentfix: Sort parsers for :TSInstallInfo (diff)
downloadnvim-treesitter-966096b502b72a6a81991d5dcd59b84ad33ed499.tar
nvim-treesitter-966096b502b72a6a81991d5dcd59b84ad33ed499.tar.gz
nvim-treesitter-966096b502b72a6a81991d5dcd59b84ad33ed499.tar.bz2
nvim-treesitter-966096b502b72a6a81991d5dcd59b84ad33ed499.tar.lz
nvim-treesitter-966096b502b72a6a81991d5dcd59b84ad33ed499.tar.xz
nvim-treesitter-966096b502b72a6a81991d5dcd59b84ad33ed499.tar.zst
nvim-treesitter-966096b502b72a6a81991d5dcd59b84ad33ed499.zip
fix(CI): ensure parsers that don't require tree-sitter CLI are installed
Diffstat (limited to 'scripts/check-queries.lua')
-rwxr-xr-xscripts/check-queries.lua13
1 files changed, 13 insertions, 0 deletions
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')