mirror of
https://github.com/NotAShelf/nvf.git
synced 2024-11-26 15:06:45 +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,
|
buffer = bufnr,
|
||||||
callback = function()
|
callback = function()
|
||||||
if vim.g.formatsave then
|
if vim.g.formatsave then
|
||||||
|
if client.supports_method("textDocument/formatting") then
|
||||||
local params = require'vim.lsp.util'.make_formatting_params({})
|
local params = require'vim.lsp.util'.make_formatting_params({})
|
||||||
client.request('textDocument/formatting', params, nil, bufnr)
|
client.request('textDocument/formatting', params, nil, bufnr)
|
||||||
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
})
|
})
|
||||||
|
|
Loading…
Reference in a new issue