diff options
author | Mathias Fußenegger <mfussenegger@users.noreply.github.com> | 2022-05-25 19:38:01 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-05-25 19:38:01 +0200 |
commit | fa3492c5f7645feb979c767046b6ff335ea9d6ca (patch) | |
tree | 6c16c2e8986130fdba80415263422a8650077e4b /runtime/doc | |
parent | c6d6b8c7eb180f56e87e1427958f91a867f5cc8c (diff) | |
download | rneovim-fa3492c5f7645feb979c767046b6ff335ea9d6ca.tar.gz rneovim-fa3492c5f7645feb979c767046b6ff335ea9d6ca.tar.bz2 rneovim-fa3492c5f7645feb979c767046b6ff335ea9d6ca.zip |
feat(lsp)!: turn format filter into predicate (#18458)
This makes the common use case easier.
If one really needs access to all clients, they can create a filter
function which manually calls `get_active_clients`.
Diffstat (limited to 'runtime/doc')
-rw-r--r-- | runtime/doc/lsp.txt | 14 |
1 files changed, 4 insertions, 10 deletions
diff --git a/runtime/doc/lsp.txt b/runtime/doc/lsp.txt index af3189a393..841ed36421 100644 --- a/runtime/doc/lsp.txt +++ b/runtime/doc/lsp.txt @@ -1120,19 +1120,13 @@ format({options}) *vim.lsp.buf.format()* • bufnr (number|nil): Restrict formatting to the clients attached to the given buffer, defaults to the current buffer (0). - • filter (function|nil): Predicate to filter clients used - for formatting. Receives the list of clients attached to - bufnr as the argument and must return the list of - clients on which to request formatting. Example: • > + • filter (function|nil): Predicate used to filter clients. + Receives a client as argument and must return a boolean. + Clients matching the predicate are included. Example: • > -- Never request typescript-language-server for formatting vim.lsp.buf.format { - filter = function(clients) - return vim.tbl_filter( - function(client) return client.name ~= "tsserver" end, - clients - ) - end + filter = function(client) return client.name ~= "tsserver" end } < • async boolean|nil If true the method won't block. |