+7
-3
lua/gopher/_utils/ts/init.lua
+7
-3
lua/gopher/_utils/ts/init.lua
···
18
18
}
19
19
end
20
20
21
-
---@param row any
22
-
---@param col any
23
-
---@param bufnr any
21
+
---@param row string
22
+
---@param col string
23
+
---@param bufnr string
24
24
---@return table|nil
25
25
function M.get_struct_node_at_pos(row, col, bufnr)
26
26
local query = M.querys.struct_block .. " " .. M.querys.em_struct_block
···
33
33
end
34
34
end
35
35
36
+
---@param row string
37
+
---@param col string
38
+
---@param bufnr string
39
+
---@return table|nil
36
40
function M.get_func_method_node_at_pos(row, col, bufnr)
37
41
local query = M.querys.func .. " " .. M.querys.method_name
38
42
local bufn = bufnr or vim.api.nvim_get_current_buf()
+1
lua/gopher/gogenerate.lua
+1
lua/gopher/gogenerate.lua
+1
lua/gopher/goget.lua
+1
lua/gopher/goget.lua
+1
lua/gopher/gomod.lua
+1
lua/gopher/gomod.lua
+2
lua/gopher/gotests.lua
+2
lua/gopher/gotests.lua
+1
-3
lua/gopher/impl.lua
+1
-3
lua/gopher/impl.lua
···
1
1
local Job = require "plenary.job"
2
2
local ts_utils = require "gopher._utils.ts"
3
3
4
+
---@return string
4
5
local function get_struct()
5
6
local ns = ts_utils.get_struct_node_at_pos(unpack(vim.api.nvim_win_get_cursor(0)))
6
7
if ns == nil then
···
68
69
local pos = vim.fn.getcurpos()[2]
69
70
table.insert(res_data, 1, "")
70
71
vim.fn.append(pos, res_data)
71
-
72
-
-- table.insert(res_data, 1, "")
73
-
-- vim.fn.append(vim.fn.getcurpos()[2], res_data)
74
72
end