refactor(ts): add assert just to be sure that all elements are in the result
This commit is contained in:
parent
1514cef8f9
commit
35aecae7ab
1 changed files with 1 additions and 0 deletions
|
|
@ -77,6 +77,7 @@ local function do_stuff(bufnr, parent_type, query)
|
||||||
|
|
||||||
local q = vim.treesitter.query.parse("go", query)
|
local q = vim.treesitter.query.parse("go", query)
|
||||||
local res = get_captures(q, parent_node, bufnr)
|
local res = get_captures(q, parent_node, bufnr)
|
||||||
|
assert(res.name ~= nil, "No capture name found")
|
||||||
|
|
||||||
local start_row, _, end_row, _ = parent_node:range()
|
local start_row, _, end_row, _ = parent_node:range()
|
||||||
res["start_line"] = start_row + 1
|
res["start_line"] = start_row + 1
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue