diff options
author | Steven Arcangeli <stevearc@stevearc.com> | 2024-05-22 00:49:10 -0700 |
---|---|---|
committer | Steven Arcangeli <stevearc@stevearc.com> | 2024-05-22 13:06:33 -0700 |
commit | f3b930db4964d60e255c8f9e37b7f2218dfc08cb (patch) | |
tree | 66b29ab4ffd7aa66d07f78a206eeb82e1ee5fe15 /doc/conform.txt | |
parent | 9b26e81c4292106e68dda3e7b64473434fd5b3e0 (diff) |
doc: add type annotations for setup() function
Diffstat (limited to 'doc/conform.txt')
-rw-r--r-- | doc/conform.txt | 26 |
1 files changed, 25 insertions, 1 deletions
diff --git a/doc/conform.txt b/doc/conform.txt index 2048692..4271e95 100644 --- a/doc/conform.txt +++ b/doc/conform.txt @@ -51,7 +51,7 @@ OPTIONS *conform-option log_level = vim.log.levels.ERROR, -- Conform will notify you when a formatter errors notify_on_error = true, - -- Custom formatters and changes to built-in formatters + -- Custom formatters and overrides for built-in formatters formatters = { my_formatter = { -- This can be a string or a function that returns a string. @@ -109,6 +109,30 @@ OPTIONS *conform-option -------------------------------------------------------------------------------- API *conform-api* +setup({opts}) *conform.setup* + + Parameters: + {opts} `nil|conform.setupOpts` + {formatters_by_ft} `nil|table<string, conform.FiletypeFormatter>` Map + of filetype to formatters + {format_on_save} `nil|conform.FormatOpts|fun(bufnr: integer): conform.FormatOpts` I + f this is set, Conform will run the formatter on + save. It will pass the table to conform.format(). + This can also be a function that returns the table. + {format_after_save} `nil|conform.FormatOpts|fun(bufnr: integer): conform.FormatOpts` I + f this is set, Conform will run the formatter + asynchronously after save. It will pass the table + to conform.format(). This can also be a function + that returns the table. + {log_level} `nil|integer` Set the log level (e.g. + `vim.log.levels.DEBUG`). Use `:ConformInfo` to see + the location of the log file. + {notify_on_error} `nil|boolean` Conform will notify you when a + formatter errors (default true). + {formatters} `nil|table<string, conform.FormatterConfigOverride|fun(bufnr: integer): nil|conform.FormatterConfigOverride>` C + ustom formatters and overrides for built-in + formatters. + format({opts}, {callback}): boolean *conform.format* Format a buffer |