feat(ts): check if parser is found

This commit is contained in:
Oleksandr Smirnov 2025-03-23 18:43:32 +02:00
parent 867d57cfbc
commit b018a99ecc
No known key found for this signature in database

View file

@ -74,6 +74,11 @@ end
---@param query string
---@return gopher.TsResult
local function do_stuff(bufnr, parent_type, query)
local parser = vim.treesitter.get_parser(bufnr, "go")
if not parser then
error "No treesitter parser found for go"
end
local node = vim.treesitter.get_node {
bufnr = bufnr,
}