From f6266422618c6b80eaf9983d35d386b49181f70f Mon Sep 17 00:00:00 2001 From: Yuta Katayama <8683947+yutkat@users.noreply.github.com> Date: Fri, 17 Feb 2023 23:27:53 +0900 Subject: [PATCH] fix: rename ts_utils.is_in_node_range -> vim.treesitter.is_in_node_range --- lua/nvim-treesitter-playground/hl-info.lua | 2 +- lua/nvim-treesitter-playground/utils.lua | 3 +-- 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/lua/nvim-treesitter-playground/hl-info.lua b/lua/nvim-treesitter-playground/hl-info.lua index 7dc7a73..bea0050 100644 --- a/lua/nvim-treesitter-playground/hl-info.lua +++ b/lua/nvim-treesitter-playground/hl-info.lua @@ -122,7 +122,7 @@ function M.show_ts_node(opts) for _, tree in ipairs(lang_tree:trees()) do local root = tree:root() - if root and ts_utils.is_in_node_range(root, line, col) then + if root and vim.treesitter.is_in_node_range(root, line, col) then local node = root:named_descendant_for_range(line, col, line, col) local path = opts.full_path and get_full_path(node) or node:type() diff --git a/lua/nvim-treesitter-playground/utils.lua b/lua/nvim-treesitter-playground/utils.lua index 6822df3..2e1745c 100644 --- a/lua/nvim-treesitter-playground/utils.lua +++ b/lua/nvim-treesitter-playground/utils.lua @@ -1,5 +1,4 @@ local api = vim.api -local ts_utils = require "nvim-treesitter.ts_utils" local highlighter = require "vim.treesitter.highlighter" local M = {} @@ -62,7 +61,7 @@ function M.get_hl_groups_at_position(bufnr, row, col) for capture, node, metadata in iter do local hl = query.hl_cache[capture] - if hl and ts_utils.is_in_node_range(node, row, col) then + if hl and vim.treesitter.is_in_node_range(node, row, col) then local c = query._query.captures[capture] -- name of the capture in the query if c ~= nil then table.insert(matches, { capture = c, priority = metadata.priority })