Something went wrong. Try again.
Something went wrong. Try again.
1234567891011121314151617181920212223242526272829303132333435363738394041local denylist = { clangd = true, html = true, jsonls = true, pyright = true, vtsls = true, stylelint_lsp = true,}
local denylist_by_filetype = { lua = { lua_ls = true, },}
local function get_filter(bufnr) return function(client) if denylist[client.name] then return false end
local filetype = vim.api.nvim_get_option_value("filetype", { buf = bufnr or 0 }) local denylist_for_filetype = denylist_by_filetype[filetype] if not denylist_for_filetype then return true end
return not denylist_for_filetype[client.name] endend
---@param options? vim.lsp.buf.format.Optslocal function format(options) options = options or {} options.bufnr = options.bufnr or vim.api.nvim_get_current_buf() options.filter = get_filter(options.bufnr) vim.lsp.buf.format(options)end
return format