mirror of
https://github.com/NotAShelf/neovim-flake.git
synced 2024-12-21 17:59:48 +01:00
feat(downstream): check client capability before formatting
This commit is contained in:
parent
23af12349a
commit
b63d17507e
1 changed files with 2 additions and 0 deletions
|
@ -204,8 +204,10 @@ in {
|
|||
buffer = bufnr,
|
||||
callback = function()
|
||||
if vim.g.formatsave then
|
||||
if client.supports_method("textDocument/formatting") then
|
||||
local params = require'vim.lsp.util'.make_formatting_params({})
|
||||
client.request('textDocument/formatting', params, nil, bufnr)
|
||||
end
|
||||
end
|
||||
end
|
||||
})
|
||||
|
|
Loading…
Reference in a new issue