From 9f111be14818c91832db8f320c4a4aa68de0e00b Mon Sep 17 00:00:00 2001 From: Steven Arcangeli Date: Sat, 13 Jul 2024 14:39:46 -0700 Subject: refactor: deprecate formatter alternation syntax --- lua/conform/init.lua | 8 ++++++++ lua/conform/types.lua | 2 +- 2 files changed, 9 insertions(+), 1 deletion(-) (limited to 'lua/conform') diff --git a/lua/conform/init.lua b/lua/conform/init.lua index 208edc7..087445b 100644 --- a/lua/conform/init.lua +++ b/lua/conform/init.lua @@ -209,6 +209,10 @@ M.list_formatters_for_buffer = function(bufnr) local function dedupe_formatters(names, collect) for _, name in ipairs(names) do if type(name) == "table" then + vim.notify_once( + "deprecated[conform]: The nested {} syntax to run the first formatter has been replaced by the stop_after_first option. See :help conform.format. Support for the old syntax will be dropped on 2025-01-01.", + vim.log.levels.WARN + ) local alternation = {} dedupe_formatters(name, alternation) if not vim.tbl_isempty(alternation) then @@ -322,6 +326,10 @@ M.resolve_formatters = function(names, bufnr, warn_on_missing, stop_after_first) local info = M.get_formatter_info(name, bufnr) add_info(info, warn_on_missing) else + vim.notify_once( + "deprecated[conform]: The nested {} syntax to run the first formatter has been replaced by the stop_after_first option. See :help conform.format. Support for the old syntax will be dropped on 2025-01-01.", + vim.log.levels.WARN + ) -- If this is an alternation, take the first one that's available for i, v in ipairs(name) do local info = M.get_formatter_info(v, bufnr) diff --git a/lua/conform/types.lua b/lua/conform/types.lua index 9b775a9..007e84a 100644 --- a/lua/conform/types.lua +++ b/lua/conform/types.lua @@ -62,7 +62,7 @@ ---This list of formatters to run for a filetype, an any associated format options. ---@class conform.FiletypeFormatterInternal : conform.DefaultFormatOpts ----@field [integer] string|string[] +---@field [integer] string ---@alias conform.LspFormatOpts ---| '"never"' # never use the LSP for formatting (default) -- cgit v1.2.3-70-g09d2