go.nvim/lua/go/godoc.lua
2021-09-18 21:14:02 +10:00

20 lines
443 B
Lua

local utils = require("go.utils")
local run = function(func, ...)
vim.validate({func = {func, 'string'}})
local setup = {'go', 'doc', vim.trim(func)}
--
local j = vim.fn.jobstart(setup, {
on_stdout = function(jobid, data, event)
data = utils.handle_job_data(data)
if not data then
return
end
vim.lsp.util.open_floating_preview(data, 'go', {border = 'single'})
end
})
end
return {run = run}