From 35aecae7abede11719b5a1bd0caa7f538b4ac9f7 Mon Sep 17 00:00:00 2001 From: Oleksandr Smirnov Date: Wed, 19 Mar 2025 13:52:25 +0200 Subject: [PATCH] refactor(ts): add assert just to be sure that all elements are in the result --- lua/gopher/_utils/ts.lua | 1 + 1 file changed, 1 insertion(+) diff --git a/lua/gopher/_utils/ts.lua b/lua/gopher/_utils/ts.lua index 2c416d8..5815dbf 100644 --- a/lua/gopher/_utils/ts.lua +++ b/lua/gopher/_utils/ts.lua @@ -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