aboutsummaryrefslogtreecommitdiffstats
path: root/lua/conform
diff options
context:
space:
mode:
authorSteven Arcangeli <stevearc@stevearc.com>2024-07-13 14:39:46 -0700
committerSteven Arcangeli <stevearc@stevearc.com>2024-07-19 08:41:31 -0700
commit9f111be14818c91832db8f320c4a4aa68de0e00b (patch)
tree924758fb05e01fbea8ddcc578ac2efa48d3964d6 /lua/conform
parent0b3d25969e2da2f5de90cc02ccd6446aa68dd895 (diff)
refactor: deprecate formatter alternation syntax
Diffstat (limited to 'lua/conform')
-rw-r--r--lua/conform/init.lua8
-rw-r--r--lua/conform/types.lua2
2 files changed, 9 insertions, 1 deletions
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)