Skip to content

Commit

Permalink
Resolve Neovim Deprecations for version 0.10 (#26)
Browse files Browse the repository at this point in the history
* fix deprecation warnings for treesitter parse_query

* use treesitter.query.parse

* fix get_node_text deprecation
  • Loading branch information
elliottminns authored May 7, 2023
1 parent c7b061b commit 03cabf6
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions lua/gopher/_utils/ts/nodes.lua
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ function M.get_all_nodes(query, lang, _, bufnr, pos_row, _)
pos_row = pos_row or 30000

local ok, parsed_query = pcall(function()
return vim.treesitter.parse_query(lang, query)
return vim.treesitter.query.parse(lang, query)
end)
if not ok then
return nil
Expand All @@ -81,7 +81,7 @@ function M.get_all_nodes(query, lang, _, bufnr, pos_row, _)
type = string.sub(path, 1, idx - 1)

if op == "name" then
name = vim.treesitter.query.get_node_text(node, bufnr)
name = vim.treesitter.get_node_text(node, bufnr)
elseif op == "declaration" or op == "clause" then
declaration_node = node
sRow, sCol, eRow, eCol = node:range()
Expand Down

0 comments on commit 03cabf6

Please sign in to comment.