diff --git a/modules/lsp/lsp.nix b/modules/lsp/lsp.nix index 5435cc5..acec921 100644 --- a/modules/lsp/lsp.nix +++ b/modules/lsp/lsp.nix @@ -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 })