mirror of
https://github.com/nvim-treesitter/nvim-treesitter.git
synced 2026-07-01 19:17:02 -04:00
Merge pull request #16 from kyazdani42/fix-compiling-parser
fix: parser install unpack > tbl_flatten
This commit is contained in:
commit
37932fc3d3
1 changed files with 21 additions and 13 deletions
|
|
@ -155,7 +155,15 @@ local function run_install(cache_folder, package_path, ft, repo)
|
||||||
info = 'Compiling...',
|
info = 'Compiling...',
|
||||||
err = 'Error during compilation',
|
err = 'Error during compilation',
|
||||||
opts = {
|
opts = {
|
||||||
args = { '-o', 'parser.so', '-shared', '-lstdc++', unpack(repo.files), '-Os', '-I./src' },
|
args = vim.tbl_flatten({
|
||||||
|
'-o',
|
||||||
|
'parser.so',
|
||||||
|
'-shared',
|
||||||
|
'-lstdc++',
|
||||||
|
'-Os',
|
||||||
|
'-I./src',
|
||||||
|
repo.files
|
||||||
|
}),
|
||||||
cwd = compile_location
|
cwd = compile_location
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
@ -237,20 +245,20 @@ function M.checkhealth()
|
||||||
end
|
end
|
||||||
|
|
||||||
function M.list_parsers()
|
function M.list_parsers()
|
||||||
local max_len = 0
|
local max_len = 0
|
||||||
for parser_name, _ in pairs(repositories) do
|
for parser_name, _ in pairs(repositories) do
|
||||||
if #parser_name > max_len then max_len = #parser_name end
|
if #parser_name > max_len then max_len = #parser_name end
|
||||||
end
|
end
|
||||||
|
|
||||||
for parser_name, _ in pairs(repositories) do
|
for parser_name, _ in pairs(repositories) do
|
||||||
local is_installed = #api.nvim_get_runtime_file('parser/'..parser_name..'.so', false) > 0
|
local is_installed = #api.nvim_get_runtime_file('parser/'..parser_name..'.so', false) > 0
|
||||||
api.nvim_out_write(parser_name..string.rep(' ', max_len - #parser_name + 1))
|
api.nvim_out_write(parser_name..string.rep(' ', max_len - #parser_name + 1))
|
||||||
if is_installed then
|
if is_installed then
|
||||||
api.nvim_out_write("[✓] installed\n")
|
api.nvim_out_write("[✓] installed\n")
|
||||||
else
|
else
|
||||||
api.nvim_out_write("[✗] not installed\n")
|
api.nvim_out_write("[✗] not installed\n")
|
||||||
end
|
|
||||||
end
|
end
|
||||||
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
return M
|
return M
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue