···44 local comment, ns = nil, nil
5566 ns = ts_utils.get_package_node_at_pos(row, col)
77- if ns ~= nil and ns ~= {} then
77+ if ns ~= nil then
88 comment = "// Package " .. ns.name .. " provides " .. ns.name
99 return comment, ns
1010 end
11111212 ns = ts_utils.get_struct_node_at_pos(row, col)
1313- if ns ~= nil and ns ~= {} then
1313+ if ns ~= nil then
1414 comment = "// " .. ns.name .. " " .. ns.type .. " "
1515 return comment, ns
1616 end
17171818 ns = ts_utils.get_func_method_node_at_pos(row, col)
1919- if ns ~= nil and ns ~= {} then
1919+ if ns ~= nil then
2020 comment = "// " .. ns.name .. " " .. ns.type .. " "
2121 return comment, ns
2222 end
23232424 ns = ts_utils.get_interface_node_at_pos(row, col)
2525- if ns ~= nil and ns ~= {} then
2525+ if ns ~= nil then
2626 comment = "// " .. ns.name .. " " .. ns.type .. " "
2727 return comment, ns
2828 end
+1-1
lua/gopher/struct_tags.lua
···77local function modify(...)
88 local fpath = vim.fn.expand "%" ---@diagnostic disable-line: missing-parameter
99 local ns = ts_utils.get_struct_node_at_pos(unpack(vim.api.nvim_win_get_cursor(0)))
1010- if ns == nil or ns == {} then
1010+ if ns == nil then
1111 return
1212 end
1313