Skip to content

Commit 07132dc

Browse files
authored
fix: use vim.treesitter.query instead of deprecated nvim-treesitter.ts_utils (#919)
1 parent 2aa7eee commit 07132dc

File tree

1 file changed

+1
-2
lines changed

1 file changed

+1
-2
lines changed

lua/cmp/config/compare.lua

+1-2
Original file line numberDiff line numberDiff line change
@@ -175,7 +175,6 @@ compare.scopes = setmetatable({
175175
if ok then
176176
local win, buf = vim.api.nvim_get_current_win(), vim.api.nvim_get_current_buf()
177177
local cursor_row = vim.api.nvim_win_get_cursor(win)[1] - 1
178-
local ts_utils = require('nvim-treesitter.ts_utils')
179178

180179
-- Cursor scope.
181180
local cursor_scope = nil
@@ -205,7 +204,7 @@ compare.scopes = setmetatable({
205204
for _, definition in pairs(definitions) do
206205
if s <= definition.node:start() and definition.node:end_() <= e then
207206
if scope:id() == locals.containing_scope(definition.node, buf):id() then
208-
local text = ts_utils.get_node_text(definition.node)[1]
207+
local text = vim.treesitter.query.get_node_text(definition.node)[1]
209208
if not self.scopes_map[text] then
210209
self.scopes_map[text] = depth
211210
end

0 commit comments

Comments
 (0)