mirror of
https://github.com/nvim-treesitter/nvim-treesitter.git
synced 2026-07-01 19:17:02 -04:00
fix: install dependencies
This commit is contained in:
parent
9c0a99819c
commit
cd2c826972
8 changed files with 207 additions and 131 deletions
|
|
@ -74,12 +74,11 @@ end
|
|||
|
||||
---@return string[]
|
||||
function M.installed_parsers()
|
||||
local install_dir = M.get_install_dir('parser')
|
||||
local install_dir = M.get_install_dir('queries')
|
||||
|
||||
local installed = {} --- @type string[]
|
||||
for f in vim.fs.dir(install_dir) do
|
||||
local lang = assert(f:match('(.*)%..*'))
|
||||
installed[#installed + 1] = lang
|
||||
installed[#installed + 1] = f
|
||||
end
|
||||
|
||||
return installed
|
||||
|
|
@ -139,6 +138,14 @@ function M.norm_languages(languages, skip)
|
|||
end, languages) --[[@as string[] ]]
|
||||
end
|
||||
|
||||
if not (skip and skip.dependencies) then
|
||||
for _, lang in pairs(languages) do
|
||||
if parsers.configs[lang].requires then
|
||||
vim.list_extend(languages, parsers.configs[lang].requires)
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
return languages
|
||||
end
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue