diff options
| author | Christian Clason <c.clason@uni-graz.at> | 2025-05-28 13:55:33 +0200 |
|---|---|---|
| committer | Christian Clason <ch.clason+github@icloud.com> | 2025-05-29 11:52:58 +0200 |
| commit | 0860b9b1070c4e1bcce66416844b633acd8e0d2a (patch) | |
| tree | abd825da1a791c5df714c64695db14d6fd3b6618 /scripts | |
| parent | fix(install): only install queries for bundled parsers (diff) | |
| download | nvim-treesitter-0860b9b1070c4e1bcce66416844b633acd8e0d2a.tar nvim-treesitter-0860b9b1070c4e1bcce66416844b633acd8e0d2a.tar.gz nvim-treesitter-0860b9b1070c4e1bcce66416844b633acd8e0d2a.tar.bz2 nvim-treesitter-0860b9b1070c4e1bcce66416844b633acd8e0d2a.tar.lz nvim-treesitter-0860b9b1070c4e1bcce66416844b633acd8e0d2a.tar.xz nvim-treesitter-0860b9b1070c4e1bcce66416844b633acd8e0d2a.tar.zst nvim-treesitter-0860b9b1070c4e1bcce66416844b633acd8e0d2a.zip | |
fix(config): check both installed parsers and queries
Problem: Can't uninstall custom parsers without queries since
`installed_parsers` only iterates over installed queries (to include
query-only languages, and to avoid string manipulation).
Solution: Iterate over both queries and parsers to collect list of
installed languages (optionally only queries or only parsers).
Diffstat (limited to 'scripts')
| -rwxr-xr-x | scripts/check-parsers.lua | 2 | ||||
| -rwxr-xr-x | scripts/check-queries.lua | 2 |
2 files changed, 2 insertions, 2 deletions
diff --git a/scripts/check-parsers.lua b/scripts/check-parsers.lua index 08e48740d..152c8f7ea 100755 --- a/scripts/check-parsers.lua +++ b/scripts/check-parsers.lua @@ -3,7 +3,7 @@ vim.opt.runtimepath:append('.') local configs = require('nvim-treesitter.parsers') local parsers = #_G.arg > 0 and { unpack(_G.arg) } - or require('nvim-treesitter.config').installed_parsers() + or require('nvim-treesitter.config').installed_languages('parsers') local data = {} ---@type table[] local errors = {} ---@type string[] diff --git a/scripts/check-queries.lua b/scripts/check-queries.lua index 0a684f5eb..27869b6b5 100755 --- a/scripts/check-queries.lua +++ b/scripts/check-queries.lua @@ -4,7 +4,7 @@ vim.opt.runtimepath:append('.') local query_types = require('nvim-treesitter.health').bundled_queries local configs = require('nvim-treesitter.parsers') local parsers = #_G.arg > 0 and { unpack(_G.arg) } - or require('nvim-treesitter.config').installed_parsers() + or require('nvim-treesitter.config').installed_languages('queries') -- Check queries for each installed parser in parsers local errors = {} ---@type string[] |
