From b63d17507e7dee556d77d0a981cecab7df75cfff Mon Sep 17 00:00:00 2001 From: NotAShelf Date: Fri, 17 Feb 2023 00:24:47 +0300 Subject: [PATCH] feat(downstream): check client capability before formatting --- modules/lsp/lsp.nix | 2 ++ 1 file changed, 2 insertions(+) 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 })