Preview definition treesitter failure because of API changed

This commit is contained in:
ray-x 2023-03-12 02:11:40 +11:00
parent 38f1c37bbc
commit 59b89e60a8
2 changed files with 4 additions and 4 deletions

View File

@ -74,8 +74,8 @@ local function def_preview(timeout_ms, method)
local data = {}
-- result = {vim.tbl_deep_extend("force", {}, unpack(result))}
-- log("def-preview", result)
for key, value in pairs(result) do
if result[key] ~= nil and not vim.tbl_isempty(result[key]) then
for _, value in pairs(result) do
if value ~= nil and not vim.tbl_isempty(value.result) then
table.insert(data, value.result[1])
end
end

View File

@ -907,8 +907,8 @@ function M.get_node_at_pos(pos, parser)
-- local cursor = api.nvim_win_get_cursor(winnr or 0)
local cursor_range = { pos[1], pos[2] }
log(cursor_range)
local root = ts_utils.get_root_for_position(unpack(cursor_range), parser)
log(pos)
local root = ts_utils.get_root_for_position(pos[1], pos[2], parser)
if not root then
return