use neovim core treesitter API instead of nvim-treesitter plugin

This commit is contained in:
Alex
2023-11-19 16:07:14 +01:00
parent b03c3a4e3d
commit c5ca61177a

View File

@@ -96,16 +96,13 @@ function M.parse_ts(root, children, bufnr)
end
function M.get_symbols(bufnr)
local status, parsers = pcall(require, 'nvim-treesitter.parsers')
bufnr = bufnr or 0
local status, parser = pcall(vim.treesitter.get_parser, bufnr)
if not status then
return {}
end
bufnr = bufnr or 0
local parser = parsers.get_parser(bufnr)
if parser == nil then
return {}
end