mirror of
https://github.com/nvim-treesitter/nvim-treesitter.git
synced 2026-07-11 07:50:07 -04:00
properly replace deprecated tsutils functions
This commit is contained in:
parent
ab5cc6414e
commit
7eb5f1a2e3
4 changed files with 6 additions and 10 deletions
|
|
@ -1,6 +1,6 @@
|
|||
local highlighter = require "vim.treesitter.highlighter"
|
||||
local ts_utils = require "nvim-treesitter.ts_utils"
|
||||
local parsers = require "nvim-treesitter.parsers"
|
||||
local ts = vim.treesitter
|
||||
|
||||
local COMMENT_NODES = {
|
||||
markdown = "html_block",
|
||||
|
|
@ -67,7 +67,7 @@ local function check_assertions(file)
|
|||
assert.Truthy(node)
|
||||
assert.is.number(row)
|
||||
assert.is.number(col)
|
||||
if hl and ts_utils.is_in_node_range(node, row, col) then
|
||||
if hl and ts.is_in_node_range(node, row, col) then
|
||||
local c = query._query.captures[capture] -- name of the capture in the query
|
||||
if c ~= nil and c ~= "spell" and c ~= "conceal" then
|
||||
captures[c] = true
|
||||
|
|
|
|||
|
|
@ -1,8 +1,8 @@
|
|||
require "nvim-treesitter.highlight" -- yes, this is necessary to set the hlmap
|
||||
local highlighter = require "vim.treesitter.highlighter"
|
||||
local configs = require "nvim-treesitter.configs"
|
||||
local ts_utils = require "nvim-treesitter.ts_utils"
|
||||
local parsers = require "nvim-treesitter.parsers"
|
||||
local ts = vim.treesitter
|
||||
|
||||
local function check_assertions(file)
|
||||
local buf = vim.fn.bufadd(file)
|
||||
|
|
@ -39,7 +39,7 @@ local function check_assertions(file)
|
|||
local root = tstree:root()
|
||||
--- If there are multiple tree with the smallest range possible
|
||||
--- Check all of them to see if they fit or not
|
||||
if not ts_utils.is_in_node_range(root, row, col) or root == top_level_root then
|
||||
if not ts.is_in_node_range(root, row, col) or root == top_level_root then
|
||||
return
|
||||
end
|
||||
if assertion.expected_capture_name == tree:lang() then
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue