diff options
author | Steven Arcangeli <506791+stevearc@users.noreply.github.com> | 2023-12-06 22:20:29 -0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-12-06 22:20:29 -0800 |
commit | 659838ff4244ef6af095395ce68aaaf99fa8e696 (patch) | |
tree | b92754f2de1a225187769ed2c30e01a3ea703b3c /lua/conform/formatters/prettier.lua | |
parent | 8d0421a11b2944c6c059e0936a95182972921c30 (diff) |
refactor!: formatter config functions take self as first argument (#233)
This is a breaking API change, but there is a shim in place that will keep existing functions working, just with a warning notification. Most people should not encounter this at all. For anyone overriding a formatter config value with a function that takes `(ctx)` as the parameter, it will need to be updated to take `(self, ctx)`.
Diffstat (limited to 'lua/conform/formatters/prettier.lua')
-rw-r--r-- | lua/conform/formatters/prettier.lua | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/lua/conform/formatters/prettier.lua b/lua/conform/formatters/prettier.lua index ea45ffb..52dda86 100644 --- a/lua/conform/formatters/prettier.lua +++ b/lua/conform/formatters/prettier.lua @@ -7,7 +7,7 @@ return { }, command = util.from_node_modules("prettier"), args = { "--stdin-filepath", "$FILENAME" }, - range_args = function(ctx) + range_args = function(self, ctx) local start_offset, end_offset = util.get_offsets_from_range(ctx.buf, ctx.range) return { "$FILENAME", "--range-start=" .. start_offset, "--range-end=" .. end_offset } end, |