reformat
This commit is contained in:
parent
327a59dda1
commit
8c4993363e
1 changed files with 3 additions and 4 deletions
|
|
@ -50,9 +50,9 @@ end
|
||||||
---@return {name:string, is_varstruct:boolean}
|
---@return {name:string, is_varstruct:boolean}
|
||||||
local function get_captures(query, node, bufnr)
|
local function get_captures(query, node, bufnr)
|
||||||
local res = {}
|
local res = {}
|
||||||
for id, n in query:iter_captures(node, bufnr) do
|
for id, _node in query:iter_captures(node, bufnr) do
|
||||||
if query.captures[id] == "_name" then
|
if query.captures[id] == "_name" then
|
||||||
res["name"] = vim.treesitter.get_node_text(n, bufnr)
|
res["name"] = vim.treesitter.get_node_text(_node, bufnr)
|
||||||
end
|
end
|
||||||
|
|
||||||
if query.captures[id] == "_var" then
|
if query.captures[id] == "_var" then
|
||||||
|
|
@ -74,8 +74,7 @@ end
|
||||||
---@param query string
|
---@param query string
|
||||||
---@return gopher.TsResult
|
---@return gopher.TsResult
|
||||||
local function do_stuff(bufnr, parent_type, query)
|
local function do_stuff(bufnr, parent_type, query)
|
||||||
local parser = vim.treesitter.get_parser(bufnr, "go")
|
if not vim.treesitter.get_parser(bufnr, "go") then
|
||||||
if not parser then
|
|
||||||
error "No treesitter parser found for go"
|
error "No treesitter parser found for go"
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue