mirror of https://github.com/ray-x/go.nvim
Add log to file. Fix gotest_fun
parent
6d41723098
commit
1bdf18bfc2
@ -0,0 +1,21 @@
|
||||
local M = {}
|
||||
local utils = require("go.utils")
|
||||
|
||||
M.test_fun = function(args)
|
||||
|
||||
local cwd = vim.fn.getcwd(0)
|
||||
local row, col = unpack(vim.api.nvim_win_get_cursor(0))
|
||||
row, col = row + 1, col + 1
|
||||
local ns = require("go.ts.go").get_func_method_node_at_pos(row, col)
|
||||
if ns == nil or ns == {} then
|
||||
return
|
||||
end
|
||||
|
||||
utils.log("parnode" .. vim.inspect(ns))
|
||||
local cmd = [[setl makeprg=go\ test\ -v\ -run\ ^]] .. ns.name
|
||||
.. [[ | lua require"go.asyncmake".make()]]
|
||||
utils.log("test cmd", cmd)
|
||||
vim.cmd(cmd)
|
||||
end
|
||||
|
||||
return M
|
Loading…
Reference in New Issue