diff --git a/lua/cmp/config/compare.lua b/lua/cmp/config/compare.lua index b198773..6458d18 100644 --- a/lua/cmp/config/compare.lua +++ b/lua/cmp/config/compare.lua @@ -175,7 +175,6 @@ compare.scopes = setmetatable({ if ok then local win, buf = vim.api.nvim_get_current_win(), vim.api.nvim_get_current_buf() local cursor_row = vim.api.nvim_win_get_cursor(win)[1] - 1 - local ts_utils = require('nvim-treesitter.ts_utils') -- Cursor scope. local cursor_scope = nil @@ -205,7 +204,7 @@ compare.scopes = setmetatable({ for _, definition in pairs(definitions) do if s <= definition.node:start() and definition.node:end_() <= e then if scope:id() == locals.containing_scope(definition.node, buf):id() then - local text = ts_utils.get_node_text(definition.node)[1] + local text = vim.treesitter.query.get_node_text(definition.node)[1] if not self.scopes_map[text] then self.scopes_map[text] = depth end