default goimport -> gopls
This commit is contained in:
parent
b31cabdfcf
commit
df84343271
@ -155,7 +155,7 @@ M.gofmt = function(...)
|
||||
end
|
||||
|
||||
M.org_imports = function()
|
||||
local r = require('go.lsp').codeaction('', 'source.organizeImports', function()
|
||||
require('go.lsp').codeaction('', 'source.organizeImports', function()
|
||||
vim.lsp.buf.format({
|
||||
async = _GO_NVIM_CFG.lsp_fmt_async,
|
||||
bufnr = vim.api.nvim_get_current_buf(),
|
||||
@ -172,7 +172,7 @@ M.org_imports = function()
|
||||
end
|
||||
|
||||
M.goimport = function(...)
|
||||
local goimport = _GO_NVIM_CFG.goimport or 'goimports'
|
||||
local goimport = _GO_NVIM_CFG.goimport or 'gopls'
|
||||
local args = { ... }
|
||||
log(args, goimport)
|
||||
if goimport == 'gopls' then
|
||||
|
@ -10,7 +10,6 @@ describe('should run gopls releated functions', function()
|
||||
local cmd = " silent exe 'e temp.go'"
|
||||
vim.cmd(cmd)
|
||||
require('go').setup({ goimport = 'gopls', lsp_cfg = true })
|
||||
_GO_NVIM_CFG.log_path = '' -- enable log to console
|
||||
it('should run import from file with gopls', function()
|
||||
local path = './fmt/goimports2.go' -- %:p:h ? %:p
|
||||
local expected =
|
||||
@ -42,6 +41,7 @@ describe('should run gopls releated functions', function()
|
||||
end)
|
||||
it('should run import from file with gopls', function()
|
||||
vim.cmd('%bdelete!')
|
||||
_GO_NVIM_CFG.log_path = '' -- enable log to console
|
||||
local expected =
|
||||
vim.fn.join(vim.fn.readfile(cur_dir .. '/lua/tests/fixtures/fmt/goimports3_golden.go'), '\n')
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user