Update reftool and fillstruct

This commit is contained in:
ray-x 2021-09-30 22:23:36 +10:00
parent 7feb745e6c
commit 569e8e4320
3 changed files with 6 additions and 2 deletions

View File

@ -337,6 +337,7 @@ require('go').setup({
lsp_codelens = true, -- set to false to disable codelens, true by default
gopls_remote_auto = true, -- add -remote=auto to gopls
gopls_cmd = nil, -- if you need to specify gopls path and cmd, e.g {"/home/user/lsp/gopls", "-logfile",
fillstruct = 'gopls', -- can be nil (use fillstruct, slower) and gopls
"/var/log/gopls.log" }
lsp_diag_hdlr = true, -- hook lsp diag handler
dap_debug = true, -- set to false to disable dap

View File

@ -2,7 +2,7 @@
local go = {}
_GO_NVIM_CFG = {
goimport = 'gopls', -- if set to 'gopls' will use gopls format, also goimport
-- fillstruct = 'gopls',
fillstruct = 'gopls',
gofmt = 'gofumpt', -- if set to gopls will use gopls format
max_line_len = 120,
tag_transform = false,

View File

@ -36,6 +36,7 @@ local function fill(cmd)
end
require("go.install").install(cmd)
log(cmd)
local file = fn.expand("%:p")
local line = fn.line(".")
local run = string.format("%s -file=%s -line=%d 2>/dev/null", cmd, file, line)
@ -93,6 +94,8 @@ function reftool.fixplurals()
})
end
reftool.fillswitch = fill('fillswitch')
reftool.fillswitch = function()
fill('fillswitch')
end
return reftool