remove reftool/fillstruct. use gopls fillstruct

pull/448/head^2
ray-x 2 months ago
parent 43850d00fe
commit 6943c99599

@ -766,7 +766,6 @@ require('go').setup({
-- settings with {}
go='go', -- go command, can be go[default] or go1.18beta1
goimport='gopls', -- goimport command, can be gopls[default] or either goimport or golines if need to split long lines
fillstruct = 'gopls', -- default, can also use fillstruct
gofmt = 'gofumpt', --gofmt cmd,
max_line_len = 128, -- max line length in golines format, Target maximum line length for golines
tag_transform = false, -- can be transform option("snakecase", "camelcase", etc) check gomodifytags for details and more options
@ -896,7 +895,6 @@ vim.g.null_ls_disable = true
return {
go = "go", -- set to go1.18beta1 if necessary
goimport = "gopls", -- if set to 'gopls' will use gopls format, also goimport
fillstruct = "gopls",
gofmt = "gofumpt", -- if set to gopls will use gopls format
max_line_len = 120
null_ls_document_formatting_disable = true
@ -1145,7 +1143,6 @@ require("mason").setup()
require("mason-lspconfig").setup()
require('lspconfig').gopls.setup({
gopls_cmd = {install_root_dir .. '/go/gopls'},
fillstruct = 'gopls',
dap_debug = true,
dap_debug_gui = true
})

@ -30,7 +30,7 @@ end
-- can only be fillstruct and fillswitch
local function fill(cmd)
if cmd ~= 'fillstruct' and cmd ~= 'fillswitch' then
if cmd ~= 'fillswitch' then
log(cmd, 'not found')
error('cmd not supported by go.nvim', cmd)
end
@ -69,12 +69,7 @@ local function gopls_fillstruct()
end
function reftool.fillstruct()
if _GO_NVIM_CFG.fillstruct == 'gopls' then
gopls_fillstruct()
else
log('fillstruct')
fill('fillstruct')
end
gopls_fillstruct()
end
reftool.fillswitch = function()

@ -3,7 +3,7 @@ local cur_dir = vim.fn.expand('%:p:h')
local busted = require('plenary/busted')
local godir = cur_dir .. '/lua/tests/fixtures'
describe('should run gopls releated functions', function()
describe('should run gopls related functions', function()
-- vim.fn.readfile('minimal.vim')
-- vim.fn.writefile(vim.fn.readfile('fixtures/fmt/hello.go'), name)

Loading…
Cancel
Save