fix: install dependencies

This commit is contained in:
Christian Clason 2023-05-31 09:19:16 +02:00
parent 9c0a99819c
commit cd2c826972
8 changed files with 207 additions and 131 deletions

View file

@ -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