refactor: move requires in place where they used (#22)
* refactor(comment): move require to a function * refactor(gotests): move requires inside of functions * refactor(health): move requires inside of function * refactor(iferr): move requires inside of a function * refactor(impl): move some requires inside of functions * refactor(installer): move requires inside of function * refactor(struct_tags): move requires into function * refactor(dap): move import into function * refactor(utils): move import into functions
This commit is contained in:
parent
e8fe6c5b15
commit
2f0edbfdfc
10 changed files with 43 additions and 34 deletions
|
|
@ -1,11 +1,11 @@
|
|||
local Job = require "plenary.job"
|
||||
local ts_utils = require "gopher._utils.ts"
|
||||
local c = require("gopher.config").config.commands
|
||||
local u = require "gopher._utils"
|
||||
local M = {}
|
||||
|
||||
---@param cmd_args table
|
||||
local function run(cmd_args)
|
||||
local Job = require "plenary.job"
|
||||
local c = require("gopher.config").config.commands
|
||||
|
||||
Job:new({
|
||||
command = c.gotests,
|
||||
args = cmd_args,
|
||||
|
|
@ -31,6 +31,8 @@ end
|
|||
---generate unit test for one function
|
||||
---@param parallel boolean
|
||||
function M.func_test(parallel)
|
||||
local ts_utils = require "gopher._utils.ts"
|
||||
|
||||
local ns = ts_utils.get_func_method_node_at_pos(unpack(vim.api.nvim_win_get_cursor(0)))
|
||||
if ns == nil or ns.name == nil then
|
||||
u.notify("cursor on func/method and execute the command again", "info")
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue