mirror of
https://github.com/chenasraf/nvim-treesitter.git
synced 2026-05-17 17:38:02 +00:00
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).
This commit is contained in:
committed by
Christian Clason
parent
03c9048090
commit
0860b9b107
@@ -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[]
|
||||
|
||||
@@ -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[]
|
||||
|
||||
Reference in New Issue
Block a user