diff options
| -rw-r--r-- | runtime/doc/api.txt | 5 | ||||
| -rw-r--r-- | runtime/doc/diagnostic.txt | 132 | ||||
| -rw-r--r-- | runtime/doc/lsp.txt | 466 | ||||
| -rw-r--r-- | runtime/doc/lua.txt | 759 | ||||
| -rw-r--r-- | runtime/doc/treesitter.txt | 233 | ||||
| -rw-r--r-- | runtime/lua/vim/_editor.lua | 7 | ||||
| -rw-r--r-- | runtime/lua/vim/_meta/api.lua | 5 | ||||
| -rw-r--r-- | runtime/lua/vim/_system.lua | 4 | ||||
| -rw-r--r-- | runtime/lua/vim/filetype.lua | 4 | ||||
| -rw-r--r-- | runtime/lua/vim/health.lua | 2 | ||||
| -rw-r--r-- | runtime/lua/vim/iter.lua | 48 | ||||
| -rw-r--r-- | runtime/lua/vim/lsp/handlers.lua | 2 | ||||
| -rw-r--r-- | runtime/lua/vim/lsp/util.lua | 6 | ||||
| -rw-r--r-- | runtime/lua/vim/shared.lua | 2 | ||||
| -rw-r--r-- | runtime/lua/vim/treesitter/query.lua | 2 | ||||
| -rwxr-xr-x | scripts/gen_vimdoc.py | 14 | ||||
| -rw-r--r-- | scripts/lua2dox.lua | 192 | ||||
| -rw-r--r-- | src/nvim/CMakeLists.txt | 2 | ||||
| -rw-r--r-- | src/nvim/generators/luacats_grammar.lua | 136 | ||||
| -rw-r--r-- | test/functional/luacats_grammar_spec.lua | 133 |
20 files changed, 1234 insertions, 920 deletions
diff --git a/runtime/doc/api.txt b/runtime/doc/api.txt index 5b464debca..b5a49f6002 100644 --- a/runtime/doc/api.txt +++ b/runtime/doc/api.txt @@ -3381,9 +3381,8 @@ nvim_create_augroup({name}, {*opts}) *nvim_create_augroup()* • |autocmd-groups| nvim_create_autocmd({event}, {*opts}) *nvim_create_autocmd()* - Creates an |autocommand| event handler, defined by `callback` (Lua - function or Vimscript function name string) or `command` (Ex command - string). + Creates an |autocommand| event handler, defined by `callback` (Lua function + or Vimscript function name string) or `command` (Ex command string). Example using Lua callback: >lua vim.api.nvim_create_autocmd({"BufEnter", "BufWinEnter"}, { diff --git a/runtime/doc/diagnostic.txt b/runtime/doc/diagnostic.txt index ddebeb6730..5ff1c3bab5 100644 --- a/runtime/doc/diagnostic.txt +++ b/runtime/doc/diagnostic.txt @@ -390,7 +390,7 @@ config({opts}, {namespace}) *vim.diagnostic.config()* any of the above. Parameters: ~ - • {opts} (table|nil) When omitted or "nil", retrieve the current + • {opts} (`table?`) When omitted or "nil", retrieve the current configuration. Otherwise, a configuration table with the following keys: • underline: (default true) Use underline for @@ -475,55 +475,55 @@ config({opts}, {namespace}) *vim.diagnostic.config()* severities are displayed before lower severities (e.g. ERROR is displayed before WARN). Options: • reverse: (boolean) Reverse sort order - • {namespace} (integer|nil) Update the options for the given namespace. + • {namespace} (`integer?`) Update the options for the given namespace. When omitted, update the global diagnostic options. Return: ~ - (table|nil) table of current diagnostic config if `opts` is omitted. + (`table?`) table of current diagnostic config if `opts` is omitted. count({bufnr}, {opts}) *vim.diagnostic.count()* Get current diagnostics count. Parameters: ~ - • {bufnr} (integer|nil) Buffer number to get diagnostics from. Use 0 - for current buffer or nil for all buffers. - • {opts} (table|nil) A table with the following keys: + • {bufnr} (`integer?`) Buffer number to get diagnostics from. Use 0 for + current buffer or nil for all buffers. + • {opts} (`table?`) A table with the following keys: • namespace: (number) Limit diagnostics to the given namespace. • lnum: (number) Limit diagnostics to the given line number. • severity: See |diagnostic-severity|. Return: ~ - (table) A table with actually present severity values as keys (see + (`table`) A table with actually present severity values as keys (see |diagnostic-severity|) and integer counts as values. disable({bufnr}, {namespace}) *vim.diagnostic.disable()* Disable diagnostics in the given buffer. Parameters: ~ - • {bufnr} (integer|nil) Buffer number, or 0 for current buffer. - When omitted, disable diagnostics in all buffers. - • {namespace} (integer|nil) Only disable diagnostics for the given + • {bufnr} (`integer?`) Buffer number, or 0 for current buffer. When + omitted, disable diagnostics in all buffers. + • {namespace} (`integer?`) Only disable diagnostics for the given namespace. enable({bufnr}, {namespace}) *vim.diagnostic.enable()* Enable diagnostics in the given buffer. Parameters: ~ - • {bufnr} (integer|nil) Buffer number, or 0 for current buffer. - When omitted, enable diagnostics in all buffers. - • {namespace} (integer|nil) Only enable diagnostics for the given + • {bufnr} (`integer?`) Buffer number, or 0 for current buffer. When + omitted, enable diagnostics in all buffers. + • {namespace} (`integer?`) Only enable diagnostics for the given namespace. fromqflist({list}) *vim.diagnostic.fromqflist()* Convert a list of quickfix items to a list of diagnostics. Parameters: ~ - • {list} table[] List of quickfix items from |getqflist()| or + • {list} (`table[]`) List of quickfix items from |getqflist()| or |getloclist()|. Return: ~ - Diagnostic [] array of |diagnostic-structure| + (`Diagnostic[]`) array of |diagnostic-structure| get({bufnr}, {opts}) *vim.diagnostic.get()* Get current diagnostics. @@ -532,77 +532,77 @@ get({bufnr}, {opts}) *vim.diagnostic.get()* diagnostics in a buffer, use |vim.diagnostic.set()|. Parameters: ~ - • {bufnr} (integer|nil) Buffer number to get diagnostics from. Use 0 - for current buffer or nil for all buffers. - • {opts} (table|nil) A table with the following keys: + • {bufnr} (`integer?`) Buffer number to get diagnostics from. Use 0 for + current buffer or nil for all buffers. + • {opts} (`table?`) A table with the following keys: • namespace: (number) Limit diagnostics to the given namespace. • lnum: (number) Limit diagnostics to the given line number. • severity: See |diagnostic-severity|. Return: ~ - Diagnostic [] table A list of diagnostic items |diagnostic-structure|. - Keys `bufnr` , `end_lnum` , `end_col` , and `severity` are + (`Diagnostic[]`) table A list of diagnostic items + |diagnostic-structure|. Keys `bufnr` , `end_lnum` , `end_col` , and `severity` are guaranteed to be present. get_namespace({namespace}) *vim.diagnostic.get_namespace()* Get namespace metadata. Parameters: ~ - • {namespace} (integer) Diagnostic namespace + • {namespace} (`integer`) Diagnostic namespace Return: ~ - (table) Namespace metadata + (`table`) Namespace metadata get_namespaces() *vim.diagnostic.get_namespaces()* Get current diagnostic namespaces. Return: ~ - (table) A list of active diagnostic namespaces |vim.diagnostic|. + (`table`) A list of active diagnostic namespaces |vim.diagnostic|. get_next({opts}) *vim.diagnostic.get_next()* Get the next diagnostic closest to the cursor position. Parameters: ~ - • {opts} (table|nil) See |vim.diagnostic.goto_next()| + • {opts} (`table?`) See |vim.diagnostic.goto_next()| Return: ~ - Diagnostic|nil Next diagnostic + (`Diagnostic?`) Next diagnostic get_next_pos({opts}) *vim.diagnostic.get_next_pos()* Return the position of the next diagnostic in the current buffer. Parameters: ~ - • {opts} (table|nil) See |vim.diagnostic.goto_next()| + • {opts} (`table?`) See |vim.diagnostic.goto_next()| Return: ~ - table|false Next diagnostic position as a (row, col) tuple or false if - no next diagnostic. + (`table|false`) Next diagnostic position as a (row, col) tuple or + false if no next diagnostic. get_prev({opts}) *vim.diagnostic.get_prev()* Get the previous diagnostic closest to the cursor position. Parameters: ~ - • {opts} nil|table See |vim.diagnostic.goto_next()| + • {opts} (`table?`) See |vim.diagnostic.goto_next()| Return: ~ - Diagnostic|nil Previous diagnostic + (`Diagnostic?`) Previous diagnostic get_prev_pos({opts}) *vim.diagnostic.get_prev_pos()* Return the position of the previous diagnostic in the current buffer. Parameters: ~ - • {opts} (table|nil) See |vim.diagnostic.goto_next()| + • {opts} (`table?`) See |vim.diagnostic.goto_next()| Return: ~ - table|false Previous diagnostic position as a (row, col) tuple or + (`table|false`) Previous diagnostic position as a (row, col) tuple or false if there is no prior diagnostic goto_next({opts}) *vim.diagnostic.goto_next()* Move to the next diagnostic. Parameters: ~ - • {opts} (table|nil) Configuration table with the following keys: + • {opts} (`table?`) Configuration table with the following keys: • namespace: (number) Only consider diagnostics from the given namespace. • cursor_position: (cursor position) Cursor position as a @@ -623,7 +623,7 @@ goto_prev({opts}) *vim.diagnostic.goto_prev()* Move to the previous diagnostic in the current buffer. Parameters: ~ - • {opts} (table|nil) See |vim.diagnostic.goto_next()| + • {opts} (`table?`) See |vim.diagnostic.goto_next()| hide({namespace}, {bufnr}) *vim.diagnostic.hide()* Hide currently displayed diagnostics. @@ -636,22 +636,22 @@ hide({namespace}, {bufnr}) *vim.diagnostic.hide()* |vim.diagnostic.disable()|. Parameters: ~ - • {namespace} (integer|nil) Diagnostic namespace. When omitted, hide + • {namespace} (`integer?`) Diagnostic namespace. When omitted, hide diagnostics from all namespaces. - • {bufnr} (integer|nil) Buffer number, or 0 for current buffer. - When omitted, hide diagnostics in all buffers. + • {bufnr} (`integer?`) Buffer number, or 0 for current buffer. When + omitted, hide diagnostics in all buffers. is_disabled({bufnr}, {namespace}) *vim.diagnostic.is_disabled()* Check whether diagnostics are disabled in a given buffer. Parameters: ~ - • {bufnr} (integer|nil) Buffer number, or 0 for current buffer. - • {namespace} (integer|nil) Diagnostic namespace. When omitted, checks - if all diagnostics are disabled in {bufnr}. Otherwise, - only checks if diagnostics from {namespace} are disabled. + • {bufnr} (`integer?`) Buffer number, or 0 for current buffer. + • {namespace} (`integer?`) Diagnostic namespace. When omitted, checks if + all diagnostics are disabled in {bufnr}. Otherwise, only + checks if diagnostics from {namespace} are disabled. Return: ~ - (boolean) + (`boolean`) *vim.diagnostic.match()* match({str}, {pat}, {groups}, {severity_map}, {defaults}) @@ -669,25 +669,25 @@ match({str}, {pat}, {groups}, {severity_map}, {defaults}) < Parameters: ~ - • {str} (string) String to parse diagnostics from. - • {pat} (string) Lua pattern with capture groups. - • {groups} (table) List of fields in a |diagnostic-structure| to - associate with captures from {pat}. - • {severity_map} (table) A table mapping the severity field from + • {str} (`string`) String to parse diagnostics from. + • {pat} (`string`) Lua pattern with capture groups. + • {groups} (`table`) List of fields in a |diagnostic-structure| + to associate with captures from {pat}. + • {severity_map} (`table`) A table mapping the severity field from {groups} with an item from |vim.diagnostic.severity|. - • {defaults} (table|nil) Table of default values for any fields not + • {defaults} (`table?`) Table of default values for any fields not listed in {groups}. When omitted, numeric values default to 0 and "severity" defaults to ERROR. Return: ~ - Diagnostic|nil: |diagnostic-structure| or `nil` if {pat} fails to - match {str}. + (`Diagnostic?`) |diagnostic-structure| or `nil` if {pat} fails to match + {str}. open_float({opts}, {...}) *vim.diagnostic.open_float()* Show diagnostics in a floating window. Parameters: ~ - • {opts} (table|nil) Configuration table with the same keys as + • {opts} (`table?`) Configuration table with the same keys as |vim.lsp.util.open_floating_preview()| in addition to the following: • bufnr: (number) Buffer number to show diagnostics from. @@ -737,7 +737,7 @@ open_float({opts}, {...}) *vim.diagnostic.open_float()* from |vim.diagnostic.config()|. Return: ~ - integer|nil, integer|nil: ({float_bufnr}, {win_id}) + (`integer?, integer?`) ({float_bufnr}, {win_id}) reset({namespace}, {bufnr}) *vim.diagnostic.reset()* Remove all diagnostics from the given namespace. @@ -748,27 +748,27 @@ reset({namespace}, {bufnr}) *vim.diagnostic.reset()* re-displayed, use |vim.diagnostic.hide()|. Parameters: ~ - • {namespace} (integer|nil) Diagnostic namespace. When omitted, remove + • {namespace} (`integer?`) Diagnostic namespace. When omitted, remove diagnostics from all namespaces. - • {bufnr} (integer|nil) Remove diagnostics for the given buffer. + • {bufnr} (`integer?`) Remove diagnostics for the given buffer. When omitted, diagnostics are removed for all buffers. set({namespace}, {bufnr}, {diagnostics}, {opts}) *vim.diagnostic.set()* Set diagnostics for the given namespace and buffer. Parameters: ~ - • {namespace} (integer) The diagnostic namespace - • {bufnr} (integer) Buffer number - • {diagnostics} (table) A list of diagnostic items + • {namespace} (`integer`) The diagnostic namespace + • {bufnr} (`integer`) Buffer number + • {diagnostics} (`table`) A list of diagnostic items |diagnostic-structure| - • {opts} (table|nil) Display options to pass to + • {opts} (`table?`) Display options to pass to |vim.diagnostic.show()| setloclist({opts}) *vim.diagnostic.setloclist()* Add buffer diagnostics to the location list. Parameters: ~ - • {opts} (table|nil) Configuration table with the following keys: + • {opts} (`table?`) Configuration table with the following keys: • namespace: (number) Only add diagnostics from the given namespace. • winnr: (number, default 0) Window number to set location @@ -783,7 +783,7 @@ setqflist({opts}) *vim.diagnostic.setqflist()* Add all diagnostics to the quickfix list. Parameters: ~ - • {opts} (table|nil) Configuration table with the following keys: + • {opts} (`table?`) Configuration table with the following keys: • namespace: (number) Only add diagnostics from the given namespace. • open: (boolean, default true) Open quickfix list after @@ -797,17 +797,17 @@ show({namespace}, {bufnr}, {diagnostics}, {opts}) Display diagnostics for the given namespace and buffer. Parameters: ~ - • {namespace} (integer|nil) Diagnostic namespace. When omitted, show + • {namespace} (`integer?`) Diagnostic namespace. When omitted, show diagnostics from all namespaces. - • {bufnr} (integer|nil) Buffer number, or 0 for current buffer. + • {bufnr} (`integer?`) Buffer number, or 0 for current buffer. When omitted, show diagnostics in all buffers. - • {diagnostics} (table|nil) The diagnostics to display. When omitted, + • {diagnostics} (`table?`) The diagnostics to display. When omitted, use the saved diagnostics for the given namespace and buffer. This can be used to display a list of diagnostics without saving them or to display only a subset of diagnostics. May not be used when {namespace} or {bufnr} is nil. - • {opts} (table|nil) Display options. See + • {opts} (`table?`) Display options. See |vim.diagnostic.config()|. toqflist({diagnostics}) *vim.diagnostic.toqflist()* @@ -815,9 +815,9 @@ toqflist({diagnostics}) *vim.diagnostic.toqflist()* passed to |setqflist()| or |setloclist()|. Parameters: ~ - • {diagnostics} (table) List of diagnostics |diagnostic-structure|. + • {diagnostics} (`table`) List of diagnostics |diagnostic-structure|. Return: ~ - table[] of quickfix list items |setqflist-what| + (`table[]`) of quickfix list items |setqflist-what| vim:tw=78:ts=8:sw=4:sts=4:et:ft=help:norl: diff --git a/runtime/doc/lsp.txt b/runtime/doc/lsp.txt index 47c5c2379e..7e1c0a4a15 100644 --- a/runtime/doc/lsp.txt +++ b/runtime/doc/lsp.txt @@ -642,12 +642,12 @@ buf_attach_client({bufnr}, {client_id}) *vim.lsp.buf_attach_client()* Without calling this, the server won't be notified of changes to a buffer. Parameters: ~ - • {bufnr} (integer) Buffer handle, or 0 for current - • {client_id} (integer) Client id + • {bufnr} (`integer`) Buffer handle, or 0 for current + • {client_id} (`integer`) Client id Return: ~ - (boolean) success `true` if client was attached successfully; `false` - otherwise + (`boolean`) success `true` if client was attached successfully; + `false` otherwise buf_detach_client({bufnr}, {client_id}) *vim.lsp.buf_detach_client()* Detaches client from the specified buffer. Note: While the server is @@ -655,26 +655,26 @@ buf_detach_client({bufnr}, {client_id}) *vim.lsp.buf_detach_client()* send notifications should it ignore this notification. Parameters: ~ - • {bufnr} (integer) Buffer handle, or 0 for current - • {client_id} (integer) Client id + • {bufnr} (`integer`) Buffer handle, or 0 for current + • {client_id} (`integer`) Client id buf_is_attached({bufnr}, {client_id}) *vim.lsp.buf_is_attached()* Checks if a buffer is attached for a particular client. Parameters: ~ - • {bufnr} (integer) Buffer handle, or 0 for current - • {client_id} (integer) the client id + • {bufnr} (`integer`) Buffer handle, or 0 for current + • {client_id} (`integer`) the client id buf_notify({bufnr}, {method}, {params}) *vim.lsp.buf_notify()* Send a notification to a server Parameters: ~ - • {bufnr} (integer|nil) The number of the buffer - • {method} (string) Name of the request method - • {params} (any) Arguments to send to the server + • {bufnr} (`integer?`) The number of the buffer + • {method} (`string`) Name of the request method + • {params} (`any`) Arguments to send to the server Return: ~ - (boolean) success true if any client returns true; false otherwise + (`boolean`) success true if any client returns true; false otherwise *vim.lsp.buf_request_all()* buf_request_all({bufnr}, {method}, {params}, {handler}) @@ -682,14 +682,15 @@ buf_request_all({bufnr}, {method}, {params}, {handler}) executes the `handler` callback with the combined result. Parameters: ~ - • {bufnr} (integer) Buffer handle, or 0 for current. - • {method} (string) LSP method name - • {params} (table|nil) Parameters to send to the server - • {handler} (function) Handler called after all requests are completed. - Server results are passed as a `client_id:result` map. + • {bufnr} (`integer`) Buffer handle, or 0 for current. + • {method} (`string`) LSP method name + • {params} (`table?`) Parameters to send to the server + • {handler} (`function`) Handler called after all requests are + completed. Server results are passed as a + `client_id:result` map. Return: ~ - (function) cancel Function that cancels all requests. + (`function`) cancel Function that cancels all requests. *vim.lsp.buf_request_sync()* buf_request_sync({bufnr}, {method}, {params}, {timeout_ms}) @@ -700,15 +701,15 @@ buf_request_sync({bufnr}, {method}, {params}, {timeout_ms}) result is different. Waits a maximum of {timeout_ms} (default 1000) ms. Parameters: ~ - • {bufnr} (integer) Buffer handle, or 0 for current. - • {method} (string) LSP method name - • {params} (table|nil) Parameters to send to the server - • {timeout_ms} (integer|nil) Maximum time in milliseconds to wait for a + • {bufnr} (`integer`) Buffer handle, or 0 for current. + • {method} (`string`) LSP method name + • {params} (`table?`) Parameters to send to the server + • {timeout_ms} (`integer?`) Maximum time in milliseconds to wait for a result. Defaults to 1000 Return (multiple): ~ - (table) result Map of client_id:request_result. - (string|nil) err On timeout, cancel, or error, `err` is a string + (`table`) result Map of client_id:request_result. + (`string?`) err On timeout, cancel, or error, `err` is a string describing the failure reason, and `result` is nil. client() *vim.lsp.client* @@ -780,10 +781,10 @@ client_is_stopped({client_id}) *vim.lsp.client_is_stopped()* Checks whether a client is stopped. Parameters: ~ - • {client_id} (integer) + • {client_id} (`integer`) Return: ~ - (boolean) stopped true if client is stopped, false otherwise. + (`boolean`) stopped true if client is stopped, false otherwise. commands *vim.lsp.commands* Registry for client side commands. This is an extension point for plugins @@ -813,7 +814,7 @@ formatexpr({opts}) *vim.lsp.formatexpr()* 'v:lua.vim.lsp.formatexpr(#{timeout_ms:250})'`. Parameters: ~ - • {opts} (table) options for customizing the formatting expression + • {opts} (`table`) options for customizing the formatting expression which takes the following optional keys: • timeout_ms (default 500ms). The timeout period for the formatting request. @@ -823,26 +824,26 @@ get_buffers_by_client_id({client_id}) Returns list of buffers attached to client_id. Parameters: ~ - • {client_id} (integer) client id + • {client_id} (`integer`) client id Return: ~ - integer[] buffers list of buffer ids + (`integer[]`) buffers list of buffer ids get_client_by_id({client_id}) *vim.lsp.get_client_by_id()* Gets a client by id, or nil if the id is invalid. The returned client may not yet be fully initialized. Parameters: ~ - • {client_id} (integer) client id + • {client_id} (`integer`) client id Return: ~ - (nil|lsp.Client) client rpc object + (`lsp.Client?`) client rpc object get_clients({filter}) *vim.lsp.get_clients()* Get active clients. Parameters: ~ - • {filter} (table|nil) A table with key-value pairs used to filter the + • {filter} (`table?`) A table with key-value pairs used to filter the returned clients. The available keys are: • id (number): Only return clients with the given id • bufnr (number): Only return clients attached to this @@ -852,23 +853,23 @@ get_clients({filter}) *vim.lsp.get_clients()* method Return: ~ - lsp.Client []: List of |vim.lsp.client| objects + (`lsp.Client[]`) List of |vim.lsp.client| objects get_log_path() *vim.lsp.get_log_path()* Gets the path of the logfile used by the LSP client. Return: ~ - (string) path to log file + (`string`) path to log file omnifunc({findstart}, {base}) *vim.lsp.omnifunc()* Implements 'omnifunc' compatible LSP completion. Parameters: ~ - • {findstart} (integer) 0 or 1, decides behavior - • {base} (integer) findstart=0, text to match against + • {findstart} (`integer`) 0 or 1, decides behavior + • {base} (`integer`) findstart=0, text to match against Return: ~ - integer|table Decided by {findstart}: + (`integer|table`) Decided by {findstart}: • findstart=0: column where the completion starts, or -2 or -3 • findstart=1: list of matches (actually just calls |complete()|) @@ -887,7 +888,7 @@ set_log_level({level}) *vim.lsp.set_log_level()* Use `lsp.log_levels` for reverse lookup. Parameters: ~ - • {level} (integer|string) the case insensitive level name or number + • {level} (`integer|string`) the case insensitive level name or number See also: ~ • |vim.lsp.log_levels| @@ -932,9 +933,9 @@ start({config}, {opts}) *vim.lsp.start()* `ftplugin/<filetype_name>.lua` (See |ftplugin-name|) Parameters: ~ - • {config} (table) Same configuration as documented in + • {config} (`table`) Same configuration as documented in |vim.lsp.start_client()| - • {opts} (nil|lsp.StartOpts) Optional keyword arguments: + • {opts} (`lsp.StartOpts?`) Optional keyword arguments: • reuse_client (fun(client: client, config: table): boolean) Predicate used to decide if a client should be re-used. Used on all running clients. The default implementation @@ -943,7 +944,7 @@ start({config}, {opts}) *vim.lsp.start()* re-using a client (0 for current). Return: ~ - (integer|nil) client_id + (`integer?`) client_id start_client({config}) *vim.lsp.start_client()* Starts and initializes a client with the given configuration. @@ -951,7 +952,7 @@ start_client({config}) *vim.lsp.start_client()* Field `cmd` in {config} is required. Parameters: ~ - • {config} ( lsp.ClientConfig ) Configuration for the server: + • {config} (`lsp.ClientConfig`) Configuration for the server: • cmd: (string[]|fun(dispatchers: table):table) command a list of strings treated like |jobstart()|. The command must launch the language server process. `cmd` can also be @@ -1060,7 +1061,7 @@ start_client({config}) *vim.lsp.start_client()* initialization. Return: ~ - (integer|nil) client_id. |vim.lsp.get_client_by_id()| Note: client may + (`integer?`) client_id. |vim.lsp.get_client_by_id()| Note: client may not be fully initialized. Use `on_init` to do any actions once the client has been initialized. @@ -1069,7 +1070,7 @@ status() *vim.lsp.status()* a string. Empty if there are no clients or if no new messages Return: ~ - (string) + (`string`) stop_client({client_id}, {force}) *vim.lsp.stop_client()* Stops a client(s). @@ -1083,9 +1084,9 @@ stop_client({client_id}, {force}) *vim.lsp.stop_client()* for this client, then force-shutdown is attempted. Parameters: ~ - • {client_id} integer|table id or |vim.lsp.client| object, or list + • {client_id} (`integer|table`) id or |vim.lsp.client| object, or list thereof - • {force} (boolean|nil) shutdown forcefully + • {force} (`boolean?`) shutdown forcefully tagfunc({pattern}, {flags}) *vim.lsp.tagfunc()* Provides an interface between the built-in client and 'tagfunc'. @@ -1096,18 +1097,18 @@ tagfunc({pattern}, {flags}) *vim.lsp.tagfunc()* LSP servers, falls back to using built-in tags. Parameters: ~ - • {pattern} (string) Pattern used to find a workspace symbol - • {flags} (string) See |tag-function| + • {pattern} (`string`) Pattern used to find a workspace symbol + • {flags} (`string`) See |tag-function| Return: ~ - table[] tags A list of matching tags + (`table[]`) tags A list of matching tags with({handler}, {override_config}) *vim.lsp.with()* Function to manage overriding defaults for LSP handlers. Parameters: ~ - • {handler} (lsp.Handler) See |lsp-handler| - • {override_config} (table) Table containing the keys to override + • {handler} (`lsp.Handler`) See |lsp-handler| + • {override_config} (`table`) Table containing the keys to override behavior of the {handler} @@ -1126,7 +1127,7 @@ code_action({options}) *vim.lsp.buf.code_action()* Selects a code action available at the current cursor position. Parameters: ~ - • {options} (table|nil) Optional table which holds the following + • {options} (`table?`) Optional table which holds the following optional fields: • context: (table|nil) Corresponds to `CodeActionContext` of the LSP specification: @@ -1158,7 +1159,7 @@ completion({context}) *vim.lsp.buf.completion()* called in Insert mode. Parameters: ~ - • {context} (table) (context support not yet implemented) Additional + • {context} (`table`) (context support not yet implemented) Additional information about the context in which a completion was triggered (how it was triggered, and by which trigger character, if applicable) @@ -1174,7 +1175,7 @@ declaration({options}) *vim.lsp.buf.declaration()* |vim.lsp.buf.definition()| instead. Parameters: ~ - • {options} (table|nil) additional options + • {options} (`table?`) additional options • reuse_win: (boolean) Jump to existing window if buffer is already open. • on_list: (function) |lsp-on-list-handler| replacing the @@ -1184,7 +1185,7 @@ definition({options}) *vim.lsp.buf.definition()* Jumps to the definition of the symbol under the cursor. Parameters: ~ - • {options} (table|nil) additional options + • {options} (`table?`) additional options • reuse_win: (boolean) Jump to existing window if buffer is already open. • on_list: (function) |lsp-on-list-handler| replacing the @@ -1208,7 +1209,7 @@ document_symbol({options}) *vim.lsp.buf.document_symbol()* Lists all symbols in the current buffer in the quickfix window. Parameters: ~ - • {options} (table|nil) additional options + • {options} (`table?`) additional options • on_list: (function) handler for list results. See |lsp-on-list-handler| @@ -1216,7 +1217,7 @@ execute_command({command_params}) *vim.lsp.buf.execute_command()* Executes an LSP server command. Parameters: ~ - • {command_params} (table) A valid `ExecuteCommandParams` object + • {command_params} (`table`) A valid `ExecuteCommandParams` object See also: ~ • https://microsoft.github.io/language-server-protocol/specifications/specification-current/#workspace_executeCommand @@ -1226,7 +1227,7 @@ format({options}) *vim.lsp.buf.format()* server clients. Parameters: ~ - • {options} (table|nil) Optional table which holds the following + • {options} (`table?`) Optional table which holds the following optional fields: • formatting_options (table|nil): Can be used to specify FormattingOptions. Some unspecified options will be @@ -1268,7 +1269,7 @@ implementation({options}) *vim.lsp.buf.implementation()* quickfix window. Parameters: ~ - • {options} (table|nil) additional options + • {options} (`table?`) additional options • on_list: (function) |lsp-on-list-handler| replacing the default handler. Called for any non-empty result. @@ -1290,8 +1291,8 @@ references({context}, {options}) *vim.lsp.buf.references()* window. Parameters: ~ - • {context} (table|nil) Context for the request - • {options} (table|nil) additional options + • {context} (`table?`) Context for the request + • {options} (`table?`) additional options • on_list: (function) handler for list results. See |lsp-on-list-handler| @@ -1307,9 +1308,9 @@ rename({new_name}, {options}) *vim.lsp.buf.rename()* Renames all references to the symbol under the cursor. Parameters: ~ - • {new_name} (string|nil) If not provided, the user will be prompted - for a new name using |vim.ui.input()|. - • {options} (table|nil) additional options + • {new_name} (`string?`) If not provided, the user will be prompted for + a new name using |vim.ui.input()|. + • {options} (`table?`) additional options • filter (function|nil): Predicate used to filter clients. Receives a client as argument and must return a boolean. Clients matching the predi |