Remove excluded clients
Should be disabled in LSP configuration
This commit is contained in:
parent
d174718477
commit
0dc654ae2e
1 changed files with 0 additions and 4 deletions
|
|
@ -180,15 +180,11 @@ local enable_formatting = os.getenv("enable_formatting") == 'true';
|
||||||
|
|
||||||
-- format buffers before saving for specific LSPs
|
-- format buffers before saving for specific LSPs
|
||||||
if (enable_formatting) then
|
if (enable_formatting) then
|
||||||
local excluded_clients = { 'pyright' }
|
|
||||||
|
|
||||||
vim.api.nvim_create_autocmd('LspAttach', {
|
vim.api.nvim_create_autocmd('LspAttach', {
|
||||||
group = vim.api.nvim_create_augroup('lsp', { clear = true }),
|
group = vim.api.nvim_create_augroup('lsp', { clear = true }),
|
||||||
callback = function(args)
|
callback = function(args)
|
||||||
local client = vim.lsp.get_client_by_id(args.data.client_id)
|
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
|
if client.server_capabilities.documentFormattingProvider then
|
||||||
vim.api.nvim_create_autocmd('BufWritePre', {
|
vim.api.nvim_create_autocmd('BufWritePre', {
|
||||||
buffer = args.buf,
|
buffer = args.buf,
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue