7 files changed,
14 insertions(+),
6 deletions(-)
Author:
Smirnov Olexander
ss2316544@gmail.com
Committed at:
2022-06-22 14:42:14 +0300
Parent:
c1de269
M
lua/gopher/_utils/ts/init.lua
@@ -18,9 +18,9 @@ ["for"] = "for",
} end ----@param row any ----@param col any ----@param bufnr any +---@param row string +---@param col string +---@param bufnr string ---@return table|nil function M.get_struct_node_at_pos(row, col, bufnr) local query = M.querys.struct_block .. " " .. M.querys.em_struct_block@@ -33,6 +33,10 @@ return ns[#ns]
end end +---@param row string +---@param col string +---@param bufnr string +---@return table|nil function M.get_func_method_node_at_pos(row, col, bufnr) local query = M.querys.func .. " " .. M.querys.method_name local bufn = bufnr or vim.api.nvim_get_current_buf()
M
lua/gopher/gogenerate.lua
@@ -1,5 +1,6 @@
local Job = require "plenary.job" +---run "go generate" return function(...) local args = { ... } if #args == 1 and args[1] == "%" then
M
lua/gopher/goget.lua
@@ -1,5 +1,6 @@
local Job = require "plenary.job" +---run "go get" return function(...) local args = { ... } for i, arg in ipairs(args) do
M
lua/gopher/gomod.lua
@@ -1,5 +1,6 @@
local Job = require "plenary.job" +---run "go mod" return function(...) local args = { ... } local cmd_args = vim.list_extend({ "mod" }, args)
M
lua/gopher/gotests.lua
@@ -45,6 +45,8 @@
add_test(cmd_args) end +---generate unit tests for all functions in current file +---@param parallel boolean function M.all_tests(parallel) local cmd_args = { "-all" } if parallel then
M
lua/gopher/impl.lua
@@ -1,6 +1,7 @@
local Job = require "plenary.job" local ts_utils = require "gopher._utils.ts" +---@return string local function get_struct() local ns = ts_utils.get_struct_node_at_pos(unpack(vim.api.nvim_win_get_cursor(0))) if ns == nil then@@ -68,7 +69,4 @@
local pos = vim.fn.getcurpos()[2] table.insert(res_data, 1, "") vim.fn.append(pos, res_data) - - -- table.insert(res_data, 1, "") - -- vim.fn.append(vim.fn.getcurpos()[2], res_data) end
M
lua/gopher/installer.lua
@@ -5,6 +5,7 @@ impl = "github.com/josharian/impl",
gotests = "github.com/cweill/gotests", } +---@param pkg string local function install(pkg) local url = urls[pkg] .. "@latest"