refactor(ts): add assert just to be sure that all elements are in the result

This commit is contained in:
Oleksandr Smirnov 2025-03-19 13:52:25 +02:00
parent 1514cef8f9
commit 35aecae7ab
No known key found for this signature in database

View file

@ -77,6 +77,7 @@ local function do_stuff(bufnr, parent_type, query)
local q = vim.treesitter.query.parse("go", query)
local res = get_captures(q, parent_node, bufnr)
assert(res.name ~= nil, "No capture name found")
local start_row, _, end_row, _ = parent_node:range()
res["start_line"] = start_row + 1