From 03cabf675ce129c28bd855969a3e569edcf63366 Mon Sep 17 00:00:00 2001 From: Elliott Minns Date: Sun, 7 May 2023 09:56:26 -0500 Subject: [PATCH] Resolve Neovim Deprecations for version 0.10 (#26) * fix deprecation warnings for treesitter parse_query * use treesitter.query.parse * fix get_node_text deprecation --- lua/gopher/_utils/ts/nodes.lua | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lua/gopher/_utils/ts/nodes.lua b/lua/gopher/_utils/ts/nodes.lua index 8a217a5..87286a2 100644 --- a/lua/gopher/_utils/ts/nodes.lua +++ b/lua/gopher/_utils/ts/nodes.lua @@ -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 @@ -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()