refactor(ts): make build a local function
This commit is contained in:
+3
-3
@@ -57,7 +57,7 @@ end
|
||||
|
||||
---@param repo ow.TS.Repo
|
||||
---@param parser ow.TS.Parser
|
||||
function M.build(repo, parser)
|
||||
local function build(repo, parser)
|
||||
local path = assert(repo.path, "repo not installed: " .. repo.name)
|
||||
local cwd = parser.location and vim.fs.joinpath(path, parser.location)
|
||||
or path
|
||||
@@ -223,7 +223,7 @@ function M.setup(opts)
|
||||
pack.register_hook(repo.name, function(ev)
|
||||
repo.path = ev.path
|
||||
for _, parser in ipairs(repo.parsers) do
|
||||
M.build(repo, parser)
|
||||
build(repo, parser)
|
||||
end
|
||||
end)
|
||||
if not repo.path then
|
||||
@@ -233,7 +233,7 @@ function M.setup(opts)
|
||||
for _, parser in ipairs(repo.parsers) do
|
||||
local so = parser_so(repo.path, parser.lang)
|
||||
if changed[repo.name] or not vim.uv.fs_stat(so) then
|
||||
M.build(repo, parser)
|
||||
build(repo, parser)
|
||||
else
|
||||
vim.treesitter.language.add(parser.lang, { path = so })
|
||||
end
|
||||
|
||||
Reference in New Issue
Block a user