Skip to content

Commit

Permalink
doc: regenerate documentation
Browse files Browse the repository at this point in the history
  • Loading branch information
stevearc committed Jul 15, 2024
1 parent 6d667e9 commit 0f8c964
Show file tree
Hide file tree
Showing 2 changed files with 34 additions and 18 deletions.
33 changes: 22 additions & 11 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,9 +18,9 @@ Lightweight yet powerful formatter plugin for Neovim
- [setup(opts)](#setupopts)
- [format(opts, callback)](#formatopts-callback)
- [list_formatters(bufnr)](#list_formattersbufnr)
- [list_formatters_to_run(bufnr)](#list_formatters_to_runbufnr)
- [list_all_formatters()](#list_all_formatters)
- [get_formatter_info(formatter, bufnr)](#get_formatter_infoformatter-bufnr)
- [will_fallback_lsp(options)](#will_fallback_lspoptions)
- [Acknowledgements](#acknowledgements)

<!-- /TOC -->
Expand Down Expand Up @@ -535,7 +535,6 @@ require("conform").setup({
-- Set to false to disable merging the config with the base definition
inherit = true,
-- When inherit = true, add these additional arguments to the beginning of the command.
-- When inherit = true, add these additional arguments to the command.
-- This can also be a function, like args
prepend_args = { "--use-tabs" },
-- When inherit = true, add these additional arguments to the end of the command.
Expand Down Expand Up @@ -633,6 +632,27 @@ Retrieve the available formatters for a buffer
| ----- | -------------- | ---- |
| bufnr | `nil\|integer` | |

### list_formatters_to_run(bufnr)

`list_formatters_to_run(bufnr): conform.FormatterInfo[], boolean` \
Get the exact formatters that will be run for a buffer.

| Param | Type | Desc |
| ----- | -------------- | ---- |
| bufnr | `nil\|integer` | |

Returns:

| Type | Desc |
| ----------------------- | -------------------------- |
| conform.FormatterInfo[] | |
| boolean | lsp Will use LSP formatter |

**Note:**
<pre>
This accounts for stop_after_first, lsp fallback logic, etc.
</pre>

### list_all_formatters()

`list_all_formatters(): conform.FormatterInfo[]` \
Expand All @@ -648,15 +668,6 @@ Get information about a formatter (including availability)
| --------- | -------------- | ------------------------- |
| formatter | `string` | The name of the formatter |
| bufnr | `nil\|integer` | |

### will_fallback_lsp(options)

`will_fallback_lsp(options): boolean` \
Check if the buffer will use LSP formatting when lsp_format = "fallback"

| Param | Type | Desc |
| ------- | ------------ | ------------------------------------ |
| options | `nil\|table` | Options passed to vim.lsp.buf.format |
<!-- /API -->

## Acknowledgements
Expand Down
19 changes: 12 additions & 7 deletions doc/conform.txt
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,6 @@ OPTIONS *conform-option
-- Set to false to disable merging the config with the base definition
inherit = true,
-- When inherit = true, add these additional arguments to the beginning of the command.
-- When inherit = true, add these additional arguments to the command.
-- This can also be a function, like args
prepend_args = { "--use-tabs" },
-- When inherit = true, add these additional arguments to the end of the command.
Expand Down Expand Up @@ -222,6 +221,18 @@ list_formatters({bufnr}): conform.FormatterInfo[] *conform.list_formatter
Parameters:
{bufnr} `nil|integer`

list_formatters_to_run({bufnr}): conform.FormatterInfo[], boolean *conform.list_formatters_to_run*
Get the exact formatters that will be run for a buffer.

Parameters:
{bufnr} `nil|integer`
Returns:
`conform.FormatterInfo[]`
`boolean` lsp Will use LSP formatter

Note:
This accounts for stop_after_first, lsp fallback logic, etc.

list_all_formatters(): conform.FormatterInfo[] *conform.list_all_formatters*
List information about all filetype-configured formatters

Expand All @@ -233,12 +244,6 @@ get_formatter_info({formatter}, {bufnr}): conform.FormatterInfo *conform.get_for
{formatter} `string` The name of the formatter
{bufnr} `nil|integer`

will_fallback_lsp({options}): boolean *conform.will_fallback_lsp*
Check if the buffer will use LSP formatting when lsp_format = "fallback"

Parameters:
{options} `nil|table` Options passed to |vim.lsp.buf.format|

--------------------------------------------------------------------------------
FORMATTERS *conform-formatters*

Expand Down

0 comments on commit 0f8c964

Please sign in to comment.