Skip to content

Commit

Permalink
Merge pull request #82 from lukas-reineke/fix-iter-matches
Browse files Browse the repository at this point in the history
fix: support `Query:iter_matches` changes in nightly Neovim
  • Loading branch information
rouge8 authored Dec 17, 2024
2 parents ea6ed7b + 096b6f6 commit 42288ef
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion lua/neotest-rust/dap.lua
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@ local util = require("neotest-rust.util")

local M = {}

local has_quantified_captures = vim.fn.has("nvim-0.11.0") == 1

--
--{
-- "target": {
Expand Down Expand Up @@ -56,7 +58,11 @@ local function collect(query, source, root)
end

if captured_nodes["mod_name"] then
local mod_name = vim.treesitter.get_node_text(captured_nodes["mod_name"], source)
local node = captured_nodes["mod_name"]
if has_quantified_captures then
node = node[#node]
end
local mod_name = vim.treesitter.get_node_text(node, source)
table.insert(mods, mod_name)
end
end
Expand Down

0 comments on commit 42288ef

Please sign in to comment.