mirror of
https://github.com/LazyVim/LazyVim.git
synced 2025-06-22 08:53:33 +02:00
feat(lsp): allow overriding options for vim.lsp.buf.format. Fixes #51
This commit is contained in:
parent
688436c9af
commit
40d363cf3f
3 changed files with 20 additions and 2 deletions
|
@ -18,7 +18,7 @@ function M.format()
|
|||
local ft = vim.bo[buf].filetype
|
||||
local have_nls = #require("null-ls.sources").get_available(ft, "NULL_LS_FORMATTING") > 0
|
||||
|
||||
vim.lsp.buf.format({
|
||||
vim.lsp.buf.format(vim.tbl_deep_extend("force", {
|
||||
bufnr = buf,
|
||||
filter = function(client)
|
||||
if have_nls then
|
||||
|
@ -26,7 +26,7 @@ function M.format()
|
|||
end
|
||||
return client.name ~= "null-ls"
|
||||
end,
|
||||
})
|
||||
}, require("lazyvim.util").opts("nvim-lspconfig").format or {}))
|
||||
end
|
||||
|
||||
function M.on_attach(client, buf)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue