fix(null-ls): stop null-ls prompt for multiple formaters
add `client.resolved_capabilities.{document_formatting,document_range_formatting}` to on_attach of lspconfig in order to eliminate null-ls prompt for 2 formaters. Not tested with more formaters like in python, I'd say that then it'll prompt still Signed-off-by: Daniel Boll <danielboll.academico@gmail.com>
This commit is contained in:
parent
e1cdf92a01
commit
ef6ecab861
1 changed files with 3 additions and 1 deletions
|
@ -1,10 +1,12 @@
|
||||||
require("plugins.configs.others").lsp_handlers()
|
require("plugins.configs.others").lsp_handlers()
|
||||||
|
|
||||||
local function on_attach(_, bufnr)
|
local function on_attach(client, bufnr)
|
||||||
local function buf_set_option(...)
|
local function buf_set_option(...)
|
||||||
vim.api.nvim_buf_set_option(bufnr, ...)
|
vim.api.nvim_buf_set_option(bufnr, ...)
|
||||||
end
|
end
|
||||||
|
|
||||||
|
client.resolved_capabilities.document_formatting = false
|
||||||
|
client.resolved_capabilities.document_range_formatting = false
|
||||||
-- Enable completion triggered by <c-x><c-o>
|
-- Enable completion triggered by <c-x><c-o>
|
||||||
buf_set_option("omnifunc", "v:lua.vim.lsp.omnifunc")
|
buf_set_option("omnifunc", "v:lua.vim.lsp.omnifunc")
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue