Skip to content
This repository has been archived by the owner on Jan 17, 2024. It is now read-only.

Commit

Permalink
Merge pull request #115 from yutkat/master
Browse files Browse the repository at this point in the history
fix: rename ts_utils.is_in_node_range -> vim.treesitter.is_in_node_range
  • Loading branch information
theHamsta committed Feb 17, 2023
2 parents c046acb + f626642 commit 4044b53
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 3 deletions.
2 changes: 1 addition & 1 deletion lua/nvim-treesitter-playground/hl-info.lua
Expand Up @@ -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()

Expand Down
3 changes: 1 addition & 2 deletions 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 = {}
Expand Down Expand Up @@ -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 })
Expand Down

0 comments on commit 4044b53

Please sign in to comment.