mirror of
https://github.com/neovim/neovim.git
synced 2025-10-26 12:27:24 +00:00
docs(lsp): correct usage examples of formatexpr (#16216)
This commit is contained in:
committed by
GitHub
parent
487286b621
commit
7899c4099b
@@ -1543,12 +1543,10 @@ end
|
||||
---
|
||||
--- Currently only supports a single client. This can be set via
|
||||
--- `setlocal formatexpr=v:lua.vim.lsp.formatexpr()` but will typically or in `on_attach`
|
||||
--- via `vim.api.nvim_buf_set_option(bufnr, 'formatexpr', 'v:lua.vim.lsp.formatexpr()')`.
|
||||
---
|
||||
--- Can additionally be wrapped with a function that passes an optional table for customization.
|
||||
--- via `vim.api.nvim_buf_set_option(bufnr, 'formatexpr', 'v:lua.vim.lsp.formatexpr(#{timeout_ms:250})')`.
|
||||
---
|
||||
---@param opts table options for customizing the formatting expression which takes the
|
||||
--- following keys:
|
||||
--- following optional keys:
|
||||
--- * timeout_ms (default 500ms). The timeout period for the formatting request.
|
||||
function lsp.formatexpr(opts)
|
||||
opts = opts or {}
|
||||
|
||||
Reference in New Issue
Block a user