mirror of
https://github.com/NotAShelf/nvf.git
synced 2024-11-22 21:30:51 +00: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