Remove excluded clients

Should be disabled in LSP configuration
This commit is contained in:
Sonny Bakker 2025-03-18 19:56:11 +01:00
parent d174718477
commit 0dc654ae2e

View file

@ -180,15 +180,11 @@ local enable_formatting = os.getenv("enable_formatting") == 'true';
-- format buffers before saving for specific LSPs
if (enable_formatting) then
local excluded_clients = { 'pyright' }
vim.api.nvim_create_autocmd('LspAttach', {
group = vim.api.nvim_create_augroup('lsp', { clear = true }),
callback = function(args)
local client = vim.lsp.get_client_by_id(args.data.client_id)
if vim.list_contains(excluded_clients, client.name) then return end;
if client.server_capabilities.documentFormattingProvider then
vim.api.nvim_create_autocmd('BufWritePre', {
buffer = args.buf,