You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
|| timeout_ms |`nil\|integer`| Time in milliseconds to block for formatting. Defaults to 1000. No effect if async = true. |
581
-
|| bufnr |`nil\|integer`| Format this buffer (default 0) |
582
-
|| 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. |
583
-
|| dry_run |`nil\|boolean`| If true don't apply formatting changes to the buffer |
584
-
|| formatters |`nil\|string[]`| List of formatters to run. Defaults to all formatters for the buffer filetype. |
585
-
||lsp_fallback|`nil\|boolean\|"always"`| Attempt LSP formatting if no formatters are available. Defaults to false. If "always", will attempt LSP formatting even if formatters are available. |
586
-
|| quiet |`nil\|boolean`| Don't show any notifications for warnings or failures. Defaults to false. |
587
-
|| 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 |
588
-
|| id |`nil\|integer`| Passed to vim.lsp.buf.format when lsp_fallback = true|
589
-
|| name |`nil\|string`| Passed to vim.lsp.buf.format when lsp_fallback = true|
590
-
|| filter |`nil\|fun(client: table): boolean`| Passed to vim.lsp.buf.format when lsp_fallback = true|
591
-
| callback |`nil\|fun(err: nil\|string, did_edit: nil\|boolean)`| Called once formatting has completed ||
|| timeout_ms |`nil\|integer`| Time in milliseconds to block for formatting. Defaults to 1000. No effect if async = true.|
581
+
|| bufnr |`nil\|integer`| Format this buffer (default 0)|
582
+
|| 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.|
583
+
|| dry_run |`nil\|boolean`| If true don't apply formatting changes to the buffer|
584
+
|| formatters |`nil\|string[]`| List of formatters to run. Defaults to all formatters for the buffer filetype.|
585
+
||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. |
586
+
|| quiet |`nil\|boolean`| Don't show any notifications for warnings or failures. Defaults to false.|
587
+
|| 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|
588
+
|| id |`nil\|integer`| Passed to vim.lsp.buf.format when using LSP formatting |
589
+
|| name |`nil\|string`| Passed to vim.lsp.buf.format when using LSP formatting |
590
+
|| filter |`nil\|fun(client: table): boolean`| Passed to vim.lsp.buf.format when using LSP formatting |
591
+
| callback |`nil\|fun(err: nil\|string, did_edit: nil\|boolean)`| Called once formatting has completed ||
592
592
593
593
Returns:
594
594
@@ -624,7 +624,7 @@ Get information about a formatter (including availability)
624
624
### will_fallback_lsp(options)
625
625
626
626
`will_fallback_lsp(options): boolean`\
627
-
Check if the buffer will use LSP formatting when lsp_fallback = true
627
+
Check if the buffer will use LSP formatting when lsp_format = "fallback"
0 commit comments