diff options
author | Micah Halter <micah@mehalter.com> | 2024-06-19 22:23:16 -0400 |
---|---|---|
committer | GitHub <noreply@github.com> | 2024-06-19 22:23:16 -0400 |
commit | 9a06e83527407a7600a2fe4e0d10adf432b6215e (patch) | |
tree | df05a50b789471da27e9c17da9aedce7a3b799c2 /README.md | |
parent | bde3bee1773c96212b6c49f009e05174f932c23a (diff) |
doc: add LSP annotations for `lsp_format` options (#461)
* doc: add LSP annotations for `lsp_format` options
* doc: regenerate documentation
---------
Co-authored-by: Steven Arcangeli <stevearc@stevearc.com>
Diffstat (limited to 'README.md')
-rw-r--r-- | README.md | 35 |
1 files changed, 20 insertions, 15 deletions
@@ -574,21 +574,26 @@ require("conform").formatters.my_formatter = { `format(opts, callback): boolean` \ Format a buffer -| Param | Type | Desc | | -| -------- | ---------------------------------------------------- | ----------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -| opts | `nil\|conform.FormatOpts` | | | -| | timeout_ms | `nil\|integer` | Time in milliseconds to block for formatting. Defaults to 1000. No effect if async = true. | -| | bufnr | `nil\|integer` | Format this buffer (default 0) | -| | async | `nil\|boolean` | If true the method won't block. Defaults to false. If the buffer is modified before the formatter completes, the formatting will be discarded. | -| | dry_run | `nil\|boolean` | If true don't apply formatting changes to the buffer | -| | formatters | `nil\|string[]` | List of formatters to run. Defaults to all formatters for the buffer filetype. | -| | lsp_format | `nil\|"never"\|"fallback"\|"prefer"\|"first"\|"last"` | "fallback" LSP formatting when no other formatters are available, "prefer" only LSP formatting when available, "first" LSP formatting then other formatters, "last" other formatters then LSP. | -| | quiet | `nil\|boolean` | Don't show any notifications for warnings or failures. Defaults to false. | -| | range | `nil\|table` | Range to format. Table must contain `start` and `end` keys with {row, col} tuples using (1,0) indexing. Defaults to current selection in visual mode | -| | id | `nil\|integer` | Passed to vim.lsp.buf.format when using LSP formatting | -| | name | `nil\|string` | Passed to vim.lsp.buf.format when using LSP formatting | -| | filter | `nil\|fun(client: table): boolean` | Passed to vim.lsp.buf.format when using LSP formatting | -| callback | `nil\|fun(err: nil\|string, did_edit: nil\|boolean)` | Called once formatting has completed | | +| Param | Type | Desc | | +| -------- | ---------------------------------------------------- | ------------------------------------ | ---------------------------------------------------------------------------------------------------------------------------------------------------- | +| opts | `nil\|conform.FormatOpts` | | | +| | timeout_ms | `nil\|integer` | Time in milliseconds to block for formatting. Defaults to 1000. No effect if async = true. | +| | bufnr | `nil\|integer` | Format this buffer (default 0) | +| | async | `nil\|boolean` | If true the method won't block. Defaults to false. If the buffer is modified before the formatter completes, the formatting will be discarded. | +| | dry_run | `nil\|boolean` | If true don't apply formatting changes to the buffer | +| | formatters | `nil\|string[]` | List of formatters to run. Defaults to all formatters for the buffer filetype. | +| | lsp_format | `nil\|conform.LspFormatOpts` | Configure if and when LSP should be used for formatting. Defaults to "never". | +| | | > `"never"` | never use the LSP for formatting (default) | +| | | > `"fallback"` | LSP formatting is used when no other formatters are available | +| | | > `"prefer"` | use only LSP formatting when available | +| | | > `"first"` | LSP formatting is used when available and then other formatters | +| | | > `"last"` | other formatters are used then LSP formatting when available | +| | quiet | `nil\|boolean` | Don't show any notifications for warnings or failures. Defaults to false. | +| | range | `nil\|table` | Range to format. Table must contain `start` and `end` keys with {row, col} tuples using (1,0) indexing. Defaults to current selection in visual mode | +| | id | `nil\|integer` | Passed to vim.lsp.buf.format when using LSP formatting | +| | name | `nil\|string` | Passed to vim.lsp.buf.format when using LSP formatting | +| | filter | `nil\|fun(client: table): boolean` | Passed to vim.lsp.buf.format when using LSP formatting | +| callback | `nil\|fun(err: nil\|string, did_edit: nil\|boolean)` | Called once formatting has completed | | Returns: |