From 0224be36b60588e88b21b8244a0bcd069699720e Mon Sep 17 00:00:00 2001 From: Anand Gaitonde Date: Mon, 27 Mar 2023 18:33:39 -0700 Subject: [PATCH] chore: nvim-treesitter.ts_utils.get_node_range -> vim.treesitter.get_node_range (#43) - 'nvim-treesitter.ts_utils.get_node_range' has been deprecated in favor of 'vim.treesitter.get_node_range' --- lua/nvim-biscuits/init.lua | 2 +- lua/nvim-biscuits/languages/html.lua | 3 +-- lua/nvim-biscuits/languages/python.lua | 5 ++--- 3 files changed, 4 insertions(+), 6 deletions(-) diff --git a/lua/nvim-biscuits/init.lua b/lua/nvim-biscuits/init.lua index f2ddf66..6a943cb 100644 --- a/lua/nvim-biscuits/init.lua +++ b/lua/nvim-biscuits/init.lua @@ -48,7 +48,7 @@ nvim_biscuits.decorate_nodes = function(bufnr, lang) ts_utils.get_named_children(node)) local start_line, start_col, end_line, end_col = - ts_utils.get_node_range(node) + vim.treesitter.get_node_range(node) local lines = vim.api.nvim_buf_get_lines(bufnr, start_line, start_line + 1, false) diff --git a/lua/nvim-biscuits/languages/html.lua b/lua/nvim-biscuits/languages/html.lua index cb1102a..a9d325d 100644 --- a/lua/nvim-biscuits/languages/html.lua +++ b/lua/nvim-biscuits/languages/html.lua @@ -1,4 +1,3 @@ -local ts_utils = require('nvim-treesitter.ts_utils') local utils = require("nvim-biscuits.utils") local language = {} @@ -7,7 +6,7 @@ local function get_node_last_line(ts_node) local bufnr = vim.api.nvim_get_current_buf() local start_row, start_col, end_row, end_col = - ts_utils.get_node_range(ts_node) + vim.treesitter.get_node_range(ts_node) local end_lines = vim.api.nvim_buf_get_lines(bufnr, end_row, end_row + 1, false) diff --git a/lua/nvim-biscuits/languages/python.lua b/lua/nvim-biscuits/languages/python.lua index 01f4a2a..c824916 100644 --- a/lua/nvim-biscuits/languages/python.lua +++ b/lua/nvim-biscuits/languages/python.lua @@ -1,4 +1,3 @@ -local ts_utils = require('nvim-treesitter.ts_utils') local utils = require("nvim-biscuits.utils") local language = {} @@ -10,9 +9,9 @@ end language.transform_text = function(ts_node, text, bufnr) local start_line, start_col, end_line, end_col = - ts_utils.get_node_range(ts_node) + vim.treesitter.get_node_range(ts_node) local parent_start_line, parent_start_col, parent_end_line, parent_end_col = - ts_utils.get_node_range(ts_node:parent()) + vim.treesitter.get_node_range(ts_node:parent()) if parent_start_line == start_line - 1 then start_line = parent_start_line start_col = parent_start_col