Skip to content

Commit

Permalink
fix: Use vim.treesitter.get_node_text() to avoid deprecation warning
Browse files Browse the repository at this point in the history
  • Loading branch information
yutkat authored and theHamsta committed Apr 3, 2023
1 parent 8db23ea commit 9dc45a6
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion lua/nvim-dap-virtual-text/virtual_text.lua
Original file line number Diff line number Diff line change
Expand Up @@ -119,7 +119,8 @@ function M.set_virtual_text(stackframe, options)
or utils.get_at_path(d, 'definition.var.node')
or utils.get_at_path(d, 'definition.parameter.node')
if node then
local name = vim.treesitter.query.get_node_text(node, buf)
local get_node_text = vim.treesitter.get_node_text or vim.treesitter.query.get_node_text
local name = get_node_text(node, buf)
local var_line, var_col = node:start()

local evaluated = variables[name]
Expand Down

0 comments on commit 9dc45a6

Please sign in to comment.