Merge pull request #115 from yutkat/master

fix: rename ts_utils.is_in_node_range -> vim.treesitter.is_in_node_range
master
Stephan Seitz 1 year ago committed by GitHub
commit 4044b53c4d
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -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()

@ -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 })

Loading…
Cancel
Save