mirror of
https://github.com/nvim-treesitter/nvim-treesitter.git
synced 2026-07-02 11:36:54 -04:00
chore: show in TSInstallInfo when parser is still loaded
This commit is contained in:
parent
94806bc5ce
commit
4e371452e0
1 changed files with 5 additions and 3 deletions
|
|
@ -14,11 +14,13 @@ local function install_info()
|
|||
|
||||
local parser_list = parsers.available_parsers()
|
||||
table.sort(parser_list)
|
||||
for _, ft in pairs(parser_list) do
|
||||
local is_installed = #api.nvim_get_runtime_file("parser/" .. ft .. ".so", false) > 0
|
||||
api.nvim_out_write(ft .. string.rep(" ", max_len - #ft + 1))
|
||||
for _, lang in pairs(parser_list) do
|
||||
local is_installed = #api.nvim_get_runtime_file("parser/" .. lang .. ".so", false) > 0
|
||||
api.nvim_out_write(lang .. string.rep(" ", max_len - #lang + 1))
|
||||
if is_installed then
|
||||
api.nvim_out_write "[✓] installed\n"
|
||||
elseif pcall(vim.treesitter.inspect_lang, lang) then
|
||||
api.nvim_out_write "[✗] not installed (but still loaded. Restart Neovim!)\n"
|
||||
else
|
||||
api.nvim_out_write "[✗] not installed\n"
|
||||
end
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue