fix: Use vim.treesitter.get_node_text() to avoid deprecation warning (#135)
* fix: Use vim.treesitter.get_node_text() to avoid deprecation warning * ref: Bump neogen version --------- Co-authored-by: danymat <d.danymat@gmail.com>
This commit is contained in:
@@ -295,7 +295,7 @@ end
|
|||||||
--- with multiple annotation conventions.
|
--- with multiple annotation conventions.
|
||||||
---@tag neogen-changelog
|
---@tag neogen-changelog
|
||||||
---@toc_entry Changes in neogen plugin
|
---@toc_entry Changes in neogen plugin
|
||||||
neogen.version = "2.13.1"
|
neogen.version = "2.13.2"
|
||||||
--minidoc_afterlines_end
|
--minidoc_afterlines_end
|
||||||
|
|
||||||
return neogen
|
return neogen
|
||||||
|
|||||||
@@ -30,7 +30,11 @@ return {
|
|||||||
---@param bufnr? number originated buffer number. Defaults to 0
|
---@param bufnr? number originated buffer number. Defaults to 0
|
||||||
---@return table newline separated list of text
|
---@return table newline separated list of text
|
||||||
get_node_text = function(node, bufnr)
|
get_node_text = function(node, bufnr)
|
||||||
return vim.split(vim.treesitter.query.get_node_text(node, bufnr or 0), "\n")
|
return vim.split(
|
||||||
|
vim.treesitter.get_node_text and vim.treesitter.get_node_text(node, bufnr or 0)
|
||||||
|
or vim.treesitter.query.get_node_text(node, bufnr or 0),
|
||||||
|
"\n"
|
||||||
|
)
|
||||||
end,
|
end,
|
||||||
|
|
||||||
--- Copies a table to another table depending of the parameters that we want to expose
|
--- Copies a table to another table depending of the parameters that we want to expose
|
||||||
@@ -43,7 +47,6 @@ return {
|
|||||||
local copy = {}
|
local copy = {}
|
||||||
|
|
||||||
for parameter, rule in pairs(rules) do
|
for parameter, rule in pairs(rules) do
|
||||||
|
|
||||||
if type(rule) == "function" then
|
if type(rule) == "function" then
|
||||||
copy[parameter] = rule(table)
|
copy[parameter] = rule(table)
|
||||||
elseif rule == true then
|
elseif rule == true then
|
||||||
|
|||||||
Reference in New Issue
Block a user