mirror of
https://github.com/Crocmagnon/dotfiles.git
synced 2024-11-22 06:28:08 +01:00
neovim: update on-save triggers for go
This commit is contained in:
parent
e2e612fc9c
commit
ab9f724c28
1 changed files with 3 additions and 3 deletions
|
@ -4,8 +4,8 @@ local augroup = vim.api.nvim_create_augroup("LspFormatting", {})
|
||||||
local opts = {
|
local opts = {
|
||||||
sources = { -- run these on save
|
sources = { -- run these on save
|
||||||
null_ls.builtins.formatting.gofumpt,
|
null_ls.builtins.formatting.gofumpt,
|
||||||
null_ls.builtins.formatting.goimports_reviser,
|
null_ls.builtins.formatting.goimports,
|
||||||
null_ls.builtins.formatting.golines,
|
null_ls.builtins.diagnostics.golangci_lint,
|
||||||
},
|
},
|
||||||
on_attach = function (client, bufnr)
|
on_attach = function (client, bufnr)
|
||||||
if client.supports_method("textDocument/formatting") then
|
if client.supports_method("textDocument/formatting") then
|
||||||
|
@ -17,7 +17,7 @@ local opts = {
|
||||||
group = augroup,
|
group = augroup,
|
||||||
buffer = bufnr,
|
buffer = bufnr,
|
||||||
callback = function()
|
callback = function()
|
||||||
vim.lsp.buf.format({bufnr = bufnr})
|
vim.lsp.buf.format({ async = false })
|
||||||
end,
|
end,
|
||||||
})
|
})
|
||||||
end
|
end
|
||||||
|
|
Loading…
Reference in a new issue