From 0b04e3908c86a26192b48715a7b1005b4498911a Mon Sep 17 00:00:00 2001 From: Folke Lemaitre Date: Sun, 1 Oct 2023 23:30:26 +0200 Subject: [PATCH] chore(format): removed format_notify option --- lua/lazyvim/plugins/lsp/format.lua | 43 ------------------------------ lua/lazyvim/plugins/lsp/init.lua | 3 --- 2 files changed, 46 deletions(-) diff --git a/lua/lazyvim/plugins/lsp/format.lua b/lua/lazyvim/plugins/lsp/format.lua index 72f18746..dbabbe53 100644 --- a/lua/lazyvim/plugins/lsp/format.lua +++ b/lua/lazyvim/plugins/lsp/format.lua @@ -53,10 +53,6 @@ function M.format(opts) return end - if M.opts.format_notify then - M.notify(formatters) - end - vim.lsp.buf.format(vim.tbl_deep_extend("force", { bufnr = buf, filter = function(client) @@ -65,45 +61,6 @@ function M.format(opts) }, require("lazyvim.util").opts("nvim-lspconfig").format or {})) end ----@param formatters LazyVimFormatters -function M.notify(formatters) - local lines = { "# Active:" } - - for _, client in ipairs(formatters.active) do - local line = "- **" .. client.name .. "**" - if client.name == "null-ls" then - line = line - .. " (" - .. table.concat( - vim.tbl_map(function(f) - return "`" .. f.name .. "`" - end, formatters.null_ls), - ", " - ) - .. ")" - end - table.insert(lines, line) - end - - if #formatters.available > 0 then - table.insert(lines, "") - table.insert(lines, "# Disabled:") - for _, client in ipairs(formatters.available) do - table.insert(lines, "- **" .. client.name .. "**") - end - end - - vim.notify(table.concat(lines, "\n"), vim.log.levels.INFO, { - title = "Formatting", - on_open = function(win) - vim.api.nvim_win_set_option(win, "conceallevel", 3) - vim.api.nvim_win_set_option(win, "spell", false) - local buf = vim.api.nvim_win_get_buf(win) - vim.treesitter.start(buf, "markdown") - end, - }) -end - -- Gets all lsp clients that support formatting. -- When a null-ls formatter is available for the current filetype, -- only null-ls formatters are returned. diff --git a/lua/lazyvim/plugins/lsp/init.lua b/lua/lazyvim/plugins/lsp/init.lua index d69ec824..178102e3 100644 --- a/lua/lazyvim/plugins/lsp/init.lua +++ b/lua/lazyvim/plugins/lsp/init.lua @@ -41,9 +41,6 @@ return { capabilities = {}, -- Automatically format on save autoformat = true, - -- Enable this to show formatters used in a notification - -- Useful for debugging formatter issues - format_notify = false, -- options for vim.lsp.buf.format -- `bufnr` and `filter` is handled by the LazyVim formatter, -- but can be also overridden when specified