feat(ts): check if parser is found
This commit is contained in:
parent
867d57cfbc
commit
b018a99ecc
1 changed files with 5 additions and 0 deletions
|
|
@ -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,
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue